Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. mysql query with lots of conditions
  2. $query = mysql_query("SELECT * FROM my_users WHERE my_regdate BETWEEN '$ftimestamp' AND '$ttimestamp' AND my_username LIKE '%$trimmed%' OR my_realname LIKE '%$trimmed%' OR my_email LIKE '%$trimmed%' ORDER BY my_id");
  3.        
  4. $query = mysql_query("SELECT * FROM my_users WHERE my_regdate BETWEEN '$ftimestamp' AND '$ttimestamp' AND (my_username LIKE '%$trimmed%' OR my_realname LIKE '%$trimmed%' OR my_email LIKE '%$trimmed%') ORDER BY my_id");
  5.        
  6. $query ="SELECT * FROM my_users WHERE my_regdate BETWEEN '$ftimestamp' AND '$ttimestamp' AND my_username LIKE '%$trimmed%' OR my_realname LIKE '%$trimmed%' OR my_email LIKE '%$trimmed%' ORDER BY my_id";
  7. $res= mysql_query($query) or die(mysql_error());