beginner JOIN question

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ms_tilly
Forum Newbie
Posts: 6
Joined: Sun Mar 19, 2006 6:52 am

beginner JOIN question

Post by ms_tilly »

im getting an error with a join. When declaring the ON part is the following ok

Code: Select all

ON profiles.refid = user.userid
does refid have to be the same as userid? thanks
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

What is the error? What does the rest of your query look like?
ms_tilly
Forum Newbie
Posts: 6
Joined: Sun Mar 19, 2006 6:52 am

Post by ms_tilly »

the error im getting is

Code: Select all

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource.....
i'm just playing around with the code so i cant post it right now

is it ok to compare a field name with a variable of a different name even though the data types are the same?

thanks
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Your query isn't what's throwing the error. You are having an issue connecting to the database.

Edit: My bad (Thx Feyd) It is an error with your query :oops: :oops:
ms_tilly
Forum Newbie
Posts: 6
Joined: Sun Mar 19, 2006 6:52 am

Post by ms_tilly »

:oops: there was a spelling mistake in my database

thank for ur help
Post Reply