Alex1646 Posted March 12, 2011 Share Posted March 12, 2011 OMFG! I have no idea what is going on! <?php if (isset($user_log)) { //************************************************************************************************************************************************ $user = $_SESSION['user']; $query = " SELECT title, sum, story_id FROM draft WHERE user='$user' "; $select = mysql_query($query); while($rows = mysql_fetch_assoc($select)); { $titledb = $rows['title']; $sumdb = $rows['sum']; $id_db = $rows['story_id']; echo "$titledb"; } } //************************************************************************************************************************************************* ?> I have no idea whats going on I have tried: 1. Using mysql_num_rows I get a number (1) 2.Trying to use the mysql_fetch_assoc outside of the while loop. The values are getting echo'ed out, but when I put the code in the while loop and the $rows=mysql_fetch_assoc in the while peramiters, nothing happening. I have also tried putting other code in the while loop and it works. Its just the mysql values. also I tried using or die(mysql_errror()), It dies but no mysql error Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted March 12, 2011 Share Posted March 12, 2011 Is the code you posted code that works, or code that does not work? Quote Link to comment Share on other sites More sharing options...
Alex1646 Posted March 12, 2011 Author Share Posted March 12, 2011 The code that does not. I cant get it to work. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted March 12, 2011 Share Posted March 12, 2011 You have got a semi-colon on the end of the while();, thereby ending the while() statement on that line. Quote Link to comment Share on other sites More sharing options...
Alex1646 Posted March 12, 2011 Author Share Posted March 12, 2011 OMG. Really??? I spent like a hour debugging that code, and it was something as mundane as a semicolon. Well, at least I will never be making that mistake again. Thanks for everyone who read this post, and thanks even more to everyone who helped me! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.