Jump to content

mysql help


simple_man_11

Recommended Posts

Can someone please tell me why my sql script is not working right?  It is suppose to look at two different tables and get the results.  The second table is a table that will manually be update so that only member will have access if they choose to..

 

$sql = "SELECT user_id, username, user_password, user_active, user_level, user_login_tries, user_last_login_try, user_email
		FROM " . USERS_TABLE . "
		WHERE username = '" . str_replace("\\'", "''", $username) . "' 
		and  user_email = (select email from  members_list where uid = '$username') ";


Link to comment
https://forums.phpfreaks.com/topic/40619-mysql-help/
Share on other sites

What error are you getting?

 

this part of your query doesn't look right to me:

and  user_email = (select email from  members_list where uid = '$username')

 

I am not advanced enough to give you the correct one, sorry.

 

Add this to the end of your code:

 

$result = mysql_query($sql)or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/40619-mysql-help/#findComment-196452
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.