simple_man_11 Posted February 28, 2007 Share Posted February 28, 2007 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 More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 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 More sharing options...
Barand Posted February 28, 2007 Share Posted February 28, 2007 Tell use the structure of the tables and exactly what you are trying to achieve. Posting code that "isn't working right" tells us nothing. Link to comment https://forums.phpfreaks.com/topic/40619-mysql-help/#findComment-196456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.