> $sql = "SELECT id, user_name, name FROM table1, table2, table3 WHERE
> =
> table1.id') AND ('table1.userid = table2.id') AND ('table2.nameid =
> table3.id')";
> $result=mysql_query( $sql );
> echo ("your id is $id");
> echo ("<BR>");
> echo ("your name is $name");
> echo ("<BR>");
> echo ("your user name is<br> $user");

Remove those single quotes from your SELECT statement. Your WHERE
statement is just evaluating to 'string' AND 'string' AND 'string',
which will be true for every row in every table. It's no wonder you're
getting an odd result. Also, are you trying to display the values from
the database here? There is no fetch_* function to get anything out of
the result set. Where is $id coming from??

I can't explain result you're getting for $user, but with these errors,
I'm sure there are more, and there's no telling what's going on...

---John Holmes...

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to