leequalls Posted January 2, 2009 Share Posted January 2, 2009 I have tried the followinf things in the code below and all of them give me an error Warning: mysql_result(): supplied argument is not a valid MySQL result resource What am I doing wrong? $email = $_SESSION["sess_name"]; $res = mysql_query("SELECT * FROM members where email=$email"); $member1 = mysql_result($res, 0, "ref1"); $member2 = mysql_result(mysql_query("SELECT ref2 FROM members where email=$email"), 0); } Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/ Share on other sites More sharing options...
Zeradin Posted January 2, 2009 Share Posted January 2, 2009 double post thing Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/#findComment-727791 Share on other sites More sharing options...
Zeradin Posted January 2, 2009 Share Posted January 2, 2009 shouldn't it be $res = mysql_query("SELECT * FROM members where email=".$email) Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/#findComment-727792 Share on other sites More sharing options...
revraz Posted January 2, 2009 Share Posted January 2, 2009 Put single quotes around '$email' Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/#findComment-727793 Share on other sites More sharing options...
leequalls Posted January 2, 2009 Author Share Posted January 2, 2009 shouldn't it be $res = mysql_query("SELECT * FROM members where email=".$email) no that would be $res = mysql_query("SELECT * FROM members where email=".$_SESSION["sess_name"]); but I get the same error with this Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/#findComment-727794 Share on other sites More sharing options...
leequalls Posted January 2, 2009 Author Share Posted January 2, 2009 thanks revraz that worked Link to comment https://forums.phpfreaks.com/topic/139151-mysql_result/#findComment-727795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.