Web Analytics Made Easy -
StatCounter Posted into table but can't see it - CodingForum

Announcement

Collapse
No announcement yet.

Posted into table but can't see it

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Posted into table but can't see it

    Hi,

    I have posted data into a table and I can see it has added a record but can't actually view the contents.

    // Get values from form
    $id=$_POST['id'];
    $url=$_POST['url'];
    // Insert data into mysql
    $sql="INSERT INTO $tbl_name(id, url)VALUES('$id','$url')";
    $result=mysql_query($sql);

    // close connection
    mysql_close();
    ?>

    The id that I am trying to get is the username of the person that is currently using the site. Here is the code I am using

    <?php
    session_start();
    if(!session_is_registered(id)){
    header("location:main_login.php");
    }
    $session['views']=1;

    ?>

    thanks in advance

  • #2
    I have posted data into a table and I can see it has added a record but can't actually view the contents.
    How did you assume it posted into table? Add some error checks and make sure that there is no error in your query.
    PHP Code:
    $result=mysql_query($sql) or die(mysql_error()); 
    I think you are missing a space in
    Code:
    $sql="INSERT INTO $tbl_name(id, url)VALUE[ICODE]S([/ICODE]'$id','$url')";
    Digitalocean Cloud Hosting (Referral link - get $10 free credit) Fameco

    Comment

    Working...
    X