What is wrong with this code?
$result = mysql_query("SELECT * FROM sites");
$resultz =mysql_query("SELECT * FROM users WHERE user=$ref");
if ((($r1=mysql_query($result)) && ($r2=mysql_query($resultz))) {
while ((($row=mysql_fetch_assoc($r1))||($row=mysql_fetch_assoc($r2))) {
echo"Your referer is ". row["referer"] .;
}
}
it keeps saying: Parse error: syntax error, unexpected '{' in line 32
line 32 is the same line as the if statement
Problem with an if statement and while loop
Moderator: General Moderators
-
ViserExcizer
- Forum Newbie
- Posts: 24
- Joined: Tue Nov 25, 2008 1:17 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Problem with an if statement and while loop
Count your opening and closing brackets.
BTW -- What on earth are you trying to do? I would suggest looping both your resultsets seperately.
BTW -- What on earth are you trying to do? I would suggest looping both your resultsets seperately.
Re: Problem with an if statement and while loop
I think you should take a look at Lisp. 
(referring to all those parentheses)
(referring to all those parentheses)