Michdd Posted October 21, 2008 Share Posted October 21, 2008 I'm using this: $result = mysql_query("SELECT * FROM middlemen ORDER BY name") or die(mysql_error()); while($row = mysql_fetch_array( $result )) { $name = $row['name']; $status = $row['status']; while($status = "Middle Man") { echo "<li>".$name."</li>"; } } Now, to test it I put 1 user in the database with the status: Middle Man. And it just repeated the name over and over. How would I make it so that it only each name, once? Link to comment https://forums.phpfreaks.com/topic/129332-solved-while-mysql-problem/ Share on other sites More sharing options...
.josh Posted October 21, 2008 Share Posted October 21, 2008 while($status == "Middle Man") { = is assignment == is comparison Link to comment https://forums.phpfreaks.com/topic/129332-solved-while-mysql-problem/#findComment-670489 Share on other sites More sharing options...
Michdd Posted October 21, 2008 Author Share Posted October 21, 2008 while($status == "Middle Man") { = is assignment == is comparison Wow, that was the stupidest mistake I ever made.. Thanks. Link to comment https://forums.phpfreaks.com/topic/129332-solved-while-mysql-problem/#findComment-670491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.