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") Quote 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") Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.