Forum Moderators: coopster

Message Too Old, No Replies

Arghh what is wrong with this simple code?

simple mysql php stuff...

         

phidentity

3:10 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



<?php global $db_list;

$conn=@mysql_connect("xx","xx","xx")
or die("Err:Conn");

$rs = @mysql_select_db("databasename", $conn) or die("er:db");

$sql="select title_name from information";

$rs=mysql_query($sql,$conn);

while ( $row = mysql_fetch_array($rs) ) ;

{

echo("info: ".$row["title_name"]);


}



?>

I havn't done PHP In ages, came back today and tried to do some simple code. I have a problem.

It just prints "info:" and thats it...

I've checked table and field names and it's all correct. What am I doing wrong?

I'm sure it's something quite simple...

Cheers!

Jon

Timotheos

3:23 pm on Jul 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it is ;-) Get rid of the semicolon on the end of this line

while ( $row = mysql_fetch_array($rs) ) ;

phidentity

4:05 pm on Jul 18, 2004 (gmt 0)

10+ Year Member



Thank You so much :)

I am an idiot!

Jon

Timotheos

4:56 pm on Jul 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No problem. It happens to all of us.