brown2005 Posted August 26, 2010 Share Posted August 26, 2010 if($id > 0) { $where = "WHERE domains_id='$id'"; }else{ $order = "ORDER BY RAND()"; } $get_mail = mysql_query("SELECT * FROM domains $order $where LIMIT 1") Link to comment https://forums.phpfreaks.com/topic/211828-help-make-this-work-please/ Share on other sites More sharing options...
guyfromfl Posted August 26, 2010 Share Posted August 26, 2010 switch $order and $where in the query. WHERE comes before the order. $get_mail = mysql_query("SELECT * FROM domains $where $order LIMIT 1") Link to comment https://forums.phpfreaks.com/topic/211828-help-make-this-work-please/#findComment-1104148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.