Page 1 of 1

BASIC join tables

Posted: Mon Nov 01, 2004 10:01 pm
by ansa1
Hi .


I am focusing a problem (with basic): mysql join tables. Since yesterday I reviewed a many posted answers regarding join tables, and mysql sources as well. Some how I did not found answer to my problem.

There are two tables, should “cooperate” together, but they don’t . LOL

Table one = Application:
apID ( INT)
apName (TEXT)

Table two=model:
mID (INT)
apID (INT)

the query : "SELECT * FROM model INNER JOIN application ON application.apID=model.apID

I expected to get: apID (numbers) - displayd in the “model” table but all what I got is only “0” . What am I doing wrong?


Thanks in advance

Posted: Mon Nov 01, 2004 10:22 pm
by neophyte
Can you dump the array onto the screen and post the result?

Code: Select all

<?php
print_r($array);

?>
did you double check case?

Posted: Tue Nov 02, 2004 12:40 am
by ansa1
Regarding arrays – No, not really!

Case is ok.

Thanks

Posted: Tue Nov 02, 2004 4:10 am
by CoderGoblin
Normally for this kind of SELECT you would simply use the following:

Code: Select all

SELECT * FROM model,application WHERE application.apID=model.apID
.

although inner join should work. Is the data correct ?

Posted: Tue Nov 02, 2004 5:34 pm
by ansa1
I am still not done, but your suggestions give me a picture, what is wrong ( me LOL) .
GODER GOBIN said it should work - certainly it should work and as he/she suggests data …. codes ….. for sure . Query works, because I got an echo from both (joined) tables.

NEOPHYTE said : Can you dump the array onto the screen and post the result?
Not really LOL , but if I want my form works, I have to LOL.
This forum is an incredible sources of PHP and DB , and I am positive that soon I will find this what I need. At least… now, I know what I should looking for .

thank you for your time. :P