...

View Full Version : Posted into table but can't see it



tau9
04-06-2009, 11:22 AM
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

abduraooft
04-06-2009, 03:14 PM
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.

$result=mysql_query($sql) or die(mysql_error());
I think you are missing a space in

$sql="INSERT INTO $tbl_name(id, url)VALUES('$id','$url')";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum