Xtremer360 Posted September 30, 2010 Share Posted September 30, 2010 I'm trying to figure out why it won't display the quote(s) for the selected person. I echoed the query and it's getting the correct id its just not displaying correctly. Any ideas? function getQuotes($id) { $id=mysql_real_escape_string($id); $sql = "SELECT * FROM `efed_bio_quotes` WHERE bio_id = '$id'"; $re = mysql_query($sql); $i = 0; $quotes = array(); $row = mysql_fetch_assoc($re); extract($row); ?> <ul id="quotes"> <?php if(count($quotes) > 0){ for($i = 0; $i < count($quotes); $i++){ echo "<li>".$quotes[$i]."</li>"; } } else{ echo '<li>This wrestler has no quotes.</li>'; } ?> </ul> <?php } Quote Link to comment https://forums.phpfreaks.com/topic/214786-not-displaying-quotes/ Share on other sites More sharing options...
mikosiko Posted September 30, 2010 Share Posted September 30, 2010 I don't see where are you populating your $quotes array Quote Link to comment https://forums.phpfreaks.com/topic/214786-not-displaying-quotes/#findComment-1117427 Share on other sites More sharing options...
Xtremer360 Posted September 30, 2010 Author Share Posted September 30, 2010 What do you suggest? Quote Link to comment https://forums.phpfreaks.com/topic/214786-not-displaying-quotes/#findComment-1117429 Share on other sites More sharing options...
mikosiko Posted September 30, 2010 Share Posted September 30, 2010 What do you suggest? review your code define if you are going to use the $quotes array or since that you are extracting the row fields use the "quote field" (don't know the field name) directly Quote Link to comment https://forums.phpfreaks.com/topic/214786-not-displaying-quotes/#findComment-1117435 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.