monkeytooth Posted July 3, 2011 Share Posted July 3, 2011 Ok, this is my query.. SELECT email FROM memb_loginInfo WHERE email IN ('".$email."') ORDER BY email ASC Which if I run that through phpMyAdmin I yield 5 results, even running it through my script I am still yielding 5 results as per echoing out the num_rows tells me. But when I try to loop through the output arrays worth of data I can only get the first result. I have tried for, foreach, while to no success. Only thing that outputs anything is the foreach. Yet I only get one. foreach($row as $found) { //echo $found; $outputArray['output'][] = array('name' => "none", 'email' => $row['email']); } Where am I going wrong here? Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 3, 2011 Share Posted July 3, 2011 You're not showing enough of your code, but it would go something like this: $query = "SELECT email FROM memb_loginInfo WHERE email IN ('{$email}') ORDER BY email ASC"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "{$row['email']}<br>\n"; } Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted July 3, 2011 Author Share Posted July 3, 2011 Yea, I found my problem a little while ago, it was something steming down right after the query that was tripping up the loop, I do appreciate the assistance none the less thank you. 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.