php - select count 3 tables -


i trying query 3 tables returning error. want code check 3 tables whether user registered in 1 of these tables if tries log in. please me i'm php beginner.

i following error:

warning: mysql_result() expects parameter 1 resource, boolean given in

this code:

//check user if exist      function user_exists($username){      $username = sanitize($username);      return (mysql_result(mysql_query("select count(`user_id`)   `users`,`admin`,`guest` `username` = '$username'"), 0) == 1) ? true : false; 

it appears attempting grab 3 different tables using single select, cannot work.

i'd suggest trying use join , if unfamiliar (and in worst case), using 3 separate select queries achieve end goal.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -