cabbie Posted October 1, 2013 Share Posted October 1, 2013 Im doing a PDO query and need help with the while loop and printout. Without showing the whole script here is the code,, Need a printout similar to this.. I can do the html etc. A format easy to read for surveyor. Voter ID 9003256Name John DoeAddress 123 Main StPhone 5553123698 http://libertarian-forum.com/larimerlp/survey.php $query = $db->query("SELECT * FROM `members` WHERE `members` . `index` = $que"); $rows = $query->fretchAll(PDO::FETCH_ASSOC); Quote Link to comment https://forums.phpfreaks.com/topic/282613-print_r/ Share on other sites More sharing options...
alpine Posted October 1, 2013 Share Posted October 1, 2013 (edited) while($rows = $query->fetch(PDO::FETCH_ASSOC)){ echo "<p>Voter ID ".$rows['voter_id']."</p>"; // next results } Edited October 1, 2013 by alpine Quote Link to comment https://forums.phpfreaks.com/topic/282613-print_r/#findComment-1452091 Share on other sites More sharing options...
cabbie Posted October 1, 2013 Author Share Posted October 1, 2013 Thanks.. I had to SELECT each one but that works.. Quote Link to comment https://forums.phpfreaks.com/topic/282613-print_r/#findComment-1452101 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.