pixeltrace Posted August 14, 2007 Share Posted August 14, 2007 hi, i need help, i need to display results from 2 different tables but having the same fields. my problem is , i dont know how my select query will be. its something like this $uSql = "SELECT * FROM table1 AND table2"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ hope you could help me with this. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/64818-how-to-select-items-on-2-tables/ Share on other sites More sharing options...
MadTechie Posted August 14, 2007 Share Posted August 14, 2007 somthing like this $uSql = "SELECT * FROM table1, table2 where table1.ID = 10"; Quote Link to comment https://forums.phpfreaks.com/topic/64818-how-to-select-items-on-2-tables/#findComment-323333 Share on other sites More sharing options...
pixeltrace Posted August 14, 2007 Author Share Posted August 14, 2007 hi, its still not working and i am getting a no data found $uSql = "SELECT * FROM jos_findit, jos_findit2"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ this is the query that i used hope you could help me with this. thanks! Quote Link to comment https://forums.phpfreaks.com/topic/64818-how-to-select-items-on-2-tables/#findComment-323342 Share on other sites More sharing options...
MadTechie Posted August 14, 2007 Share Posted August 14, 2007 try this $uSql = "SELECT * FROM jos_findit, jos_findit2"; $uResult = mysql_query($uSql, $connection)or die(mysql_error()); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ Quote Link to comment https://forums.phpfreaks.com/topic/64818-how-to-select-items-on-2-tables/#findComment-323344 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.