Strange Guestbook Problem
Posted by: superpwnage
Posted on: 2006-05-21 10:45:00
I am trying to extract the posts out of a database using this code-
$sql="SELECT * FROM guestbook ORDER BY id desc;";
$result=mysql_query($sql,$conn) or die(mysql_error());
while ($gbarray = mysql_fetch_array($result,$conn)){
$name=$gbarray['name'];
$email=$gbarray['email'];
$message=$gbarray['message'];
textbox("$name - $email","$message");
}
Yet, it is not working. I am not getting any "official" errors, however the variables are returning as blank. I did run some tests-
- I echo'd the number of rows being returned which came out as 2, which is correct.
- I also echo'd the variables, $name, $email, and $message, yet nothing was returned.
- Then I set up the code on a different page, seperate from anything else and the variables still returned blank, which shows that the problem lies in the bit of code I posted
The textbox() function is just setting up the tables with a header (the first argument) and the content (the second argument). This part is working as the textboxes are showing up, along with the " - " in the header.
What remains unkown is why the variables are coming up as blank.
Any help is appreciated,
Ben