endy
01-24-2005, 09:20 PM
I am having a problem geting my PHP script to retrive data from my sql database. I can write to it fine but not read. Ill post the code if anyone wants to take a stab at my problem, im sure it is somthing simple (i am new to this).
Ill start where I connect to the database, dont worry I defined all my connection variables earlier.
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to connect to database");
$query="INSERT INTO info VALUES ('$input')";
mysql_query($query);
$query="SELECT * FROM info;";
$result=mysql_query($query);
mysql_close();
//$calculation= "$result";
echo "&returnVal=$result";
?>
There you have it. It always gives me the error: "Resource id #3".
Thanks for any help!
Ill start where I connect to the database, dont worry I defined all my connection variables earlier.
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to connect to database");
$query="INSERT INTO info VALUES ('$input')";
mysql_query($query);
$query="SELECT * FROM info;";
$result=mysql_query($query);
mysql_close();
//$calculation= "$result";
echo "&returnVal=$result";
?>
There you have it. It always gives me the error: "Resource id #3".
Thanks for any help!