Guest User

Untitled

a guest
Aug 19th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. Check if an existing value is in a database
  2. function searchDatabase($email) {
  3. return R::findOne('users', 'email LIKE "' . $email . '"');
  4. }
  5.  
  6. $lookup = 'customerID';
  7. $result = mysql_fetch_array(mysql_query("SELECT columnName IN tableName WHERE id='".$lookup."' LIMIT 1"));
  8. $exists = is_null($result['columnName'])?false:true;
  9.  
  10. require('rb.php'); //cant make this any simpler :(
  11. R::setup(); //this could be done in rb.php but people would not like that ;)
  12.  
  13. //and then go...
  14. R::find( ... );
Add Comment
Please, Sign In to add comment