Jump to content

weird mysql problem


MDanz

Recommended Posts

the top code works and the bottom doesn't.  I'm sure their identical.. can any one spot the problem.  The top echo's $sumz... the bottom comes up blank.

 

 

<?php


     mysql_connect("localhost", "Master", "pword");
mysql_select_db("db");
   $column= mysql_query("SELECT * FROM Reply WHERE origin=5 ORDER by posted DESC")or die (mysql_error());



  
    while($row3 = mysql_fetch_assoc($column))
  {
  $avatar = htmlentities($row3['avatar']);
  $usern = htmlentities($row3['username']);

		  $sumz = htmlentities($row3['reply']);
  }
  
  echo $sumz;
  
?>

 

<?php



	  mysql_connect("localhost", "Master", "pword");
mysql_select_db("db");
   $run = mysql_query("SELECT * FROM Reply WHERE origin=5 ORDER by posted DESC")or die (mysql_error());
   
              while($runrows = mysql_fetch_assoc($run));
                 {
                         $usern = htmlentities($runrows['username']);
		$sumz = htmlentities($runrows['reply']);
		 $imagelocation = htmlentities($runrows['image']);

}
echo $sumz;

?>

Link to comment
https://forums.phpfreaks.com/topic/202180-weird-mysql-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.