debuitls Posted September 22, 2009 Share Posted September 22, 2009 Hi all, Im trying to select all the email address where the county is equal to the county variable and the starrating is is bigger or equal to the $starrating variable. $sql = "SELECT signuphotel.email FROM proposal LEFT JOIN signuphotel ON proposal.county = signuphotel.county AND proposal.starrating = signuphotel.starrating WHERE proposal.county = '$county' AND proposal.starrating >= '$starrating' AND proposal.time = NOW() "; This statement returns correctly in phpmyadmin. However when I run it in my php script I get an error saying "No recipient addresses found in header" if starrating variable is set to starrating of 4 and the there is only hotels with 5 starrating in the table. It might be straightforward question but can anyone see where im going wrong?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/175064-basic-but-giving-me-problems/ Share on other sites More sharing options...
.josh Posted September 22, 2009 Share Posted September 22, 2009 if it works fine in phpmyadmin but not in your script, check to make sure the vars are holding what you expect them to be holding (echo them out). Then check logic you have in place for displaying the message. Quote Link to comment https://forums.phpfreaks.com/topic/175064-basic-but-giving-me-problems/#findComment-922660 Share on other sites More sharing options...
debuitls Posted September 22, 2009 Author Share Posted September 22, 2009 Thanks for getting back to me Crayon Violent. Yes the variables hold the correct values. The problem is with the 'greater than' part. If the variable holds a four starrating it wont and there is only a five starhotel it wont find the larger starrating. If the variable holds a five starratting and the there is a five starrhotel then it works fine. Can anyone help Quote Link to comment https://forums.phpfreaks.com/topic/175064-basic-but-giving-me-problems/#findComment-922793 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.