jamesxg1 Posted October 2, 2010 Share Posted October 2, 2010 Hiya peeps! I have this query; "SELECT `status` FROM `statuses` WHERE `owner` = '$this->profile_id' AND MAX(`id`) ORDER BY `id` DESC LIMIT 1" Is this correct? Because it seems to run fine, but doesn't return anything at all. Many thanks, James. Link to comment https://forums.phpfreaks.com/topic/215001-is-this-query-correct/ Share on other sites More sharing options...
Q695 Posted October 2, 2010 Share Posted October 2, 2010 It wouldn't pull data if there wasn't any data in the database, is there anything in the database? It is much easier to do "select *" so that you can pull data as you need it. Link to comment https://forums.phpfreaks.com/topic/215001-is-this-query-correct/#findComment-1118394 Share on other sites More sharing options...
BlueSkyIS Posted October 2, 2010 Share Posted October 2, 2010 do you get an error when you use mysql_query? I bet you would, if you checked: $result = mysql_query($sql) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/215001-is-this-query-correct/#findComment-1118395 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.