jbwebdesign Posted June 6, 2011 Report Share Posted June 6, 2011 Hello, I am having a problem pulling a record from mysql.....this is very strange to me and i don't understand why there is nothing being returned. can someone please tell me if i am doing something wrong? This code doesn't even return an error, it just doesn't work! <?php $sql = "SELECT * FROM " . TABLE_CONTACTS . " WHERE account_num='$acn'"; $rows = $db->query($sql); while($rec2 = $db->fetch_array($rows)){ $friend[] = $rec2["friend"]; } foreach($friend as $key){ $sql = "SELECT * FROM " . TABLE_SEARCH . " WHERE account_num='$key'"; $rows = $db->query($sql); while($rec2 = $db->fetch_array($rows)){ $u = unserialize($rec2["search_field"]); print_r($u); } } ?> Quote Link to comment Share on other sites More sharing options...
rkacenski Posted June 11, 2011 Report Share Posted June 11, 2011 Hello, I am having a problem pulling a record from mysql.....this is very strange to me and i don't understand why there is nothing being returned. can someone please tell me if i am doing something wrong? This code doesn't even return an error, it just doesn't work! <?php $sql = "SELECT * FROM " . TABLE_CONTACTS . " WHERE account_num='$acn'"; $rows = $db->query($sql); while($rec2 = $db->fetch_array($rows)){ $friend[] = $rec2["friend"]; } foreach($friend as $key){ $sql = "SELECT * FROM " . TABLE_SEARCH . " WHERE account_num='$key'"; $rows = $db->query($sql); while($rec2 = $db->fetch_array($rows)){ $u = unserialize($rec2["search_field"]); print_r($u); } } ?> Theres no error because there isn't one. The problem is you PHP syntax. What are you trying to do with it? Looks like you are running the same thing twice, and what are you using as a framework. 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.
Note: Your post will require moderator approval before it will be visible.