amites Posted January 28, 2008 Share Posted January 28, 2008 Hello, Seems I've been asking lots of questions on this one, <?php $query = "SELECT s.id AS msg_id, s.subject AS subject, FROM bil_msg_sent AS s JOIN bil_msg_look AS l WHERE s.locid = l.locid ORDER BY s.msg_date ASC"; ?> I've verified that bil_msg_sent.locid has an entry that equals 22 bil_msg_look.locid has an entry that equals 22 yet every time I run this script it comes back without an entry... any idea what I'm missing? Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/ Share on other sites More sharing options...
effigy Posted January 28, 2008 Share Posted January 28, 2008 Always check queries for errors. Are you using mysql_* functions or mysqli_* objects? Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/#findComment-451684 Share on other sites More sharing options...
amites Posted January 28, 2008 Author Share Posted January 28, 2008 is it bad that I don't know what the difference is? probably mysql_ building on mySQL 5 trying to keep it compatible with mySQL 4 Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/#findComment-451695 Share on other sites More sharing options...
amites Posted January 28, 2008 Author Share Posted January 28, 2008 googled mysqli I was correct, using mysql_ still not sure why this query won't give me results, only certainty is that it's simple I always manage to solve the hard problems btw: I like your personal text on the side, one of my favorite quotes - YEY Ghandi Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/#findComment-451725 Share on other sites More sharing options...
amites Posted January 29, 2008 Author Share Posted January 29, 2008 re-wrote from scratch and it's now working, when I compare the 2 it's all the same so not sure why it wasn't working... Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/#findComment-451794 Share on other sites More sharing options...
effigy Posted January 29, 2008 Share Posted January 29, 2008 Like this: mysql_query($sql) or die (mysql_error()); The culprit is the extra comma at the end of your field list. Quote Link to comment https://forums.phpfreaks.com/topic/88271-solved-wondering-where-the-results-went/#findComment-452348 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.