Sorry my question... but why I must use JOIN if I can use SELECT * FROM table1 AND table2 AND table3 WHERE table1.id=table2.id=table3 not? thanks + _ // Emiliano Boragina _ // Diseño & Comunicación ////////////////// + _ // emiliano.boragina@xxxxxxxxx / // 15 40 58 60 02 /////////////////////////// + _ -----Mensaje original----- De: Emiliano Boragina [mailto:emiliano.boragina@xxxxxxxxx] Enviado el: Sábado, 11 de Julio de 2009 11:08 a.m. Para: 'php-db@xxxxxxxxxxxxx' Asunto: RE: mysql_insert_id() and JOIN > Hi again? > > I dont understand how to use this two? > > I read php.net and other sites, but dont understand... http://dev.mysql.com/doc/ Available in the major languages, pick your filter and start reading. Having documentation in your own language may help a lot towards understanding. > I have this four tables: table1, 2, 3 and 4 > > So the SELECT is like this?: > > <? > > $query_select = "SELECT * FROM table1 FULL JOIN table2 FULL JOIN table3 FULL > JOIN table4 ON table1.id=table2.id=table3.id=table4.id ORDER BY id ASC?; > > mysql_query($query_select); > > ?> > > This is with FULL JOIN... How identificate the left table if I want to use > LEFT JOIN? The left table is the table to the left of the join. So: SELECT id FROM table1 LEFT JOIN table2... table1 is the left table and table2 is the right table (if you were to use a RIGHT JOIN). >> With my 4 tables the sql is like this?: >> SELECT * FROM table1 LEFT JOIN table2 LEFT JOIN table3 LEFT JOIN table4 WHERE table1.id = table2.id = table3.id = table4.id > > How is the UPDATE? > > And the INSERT I dont understand yet how is it? UPDATEs and INSERTs follow the same procedure. When you INSERT an entry into the main table, you then use the function mysql_insert_id() which will give you the value of the last 'id' column generated, which you can then use to insert data into the secondary tables. >> How is the the slq query with "mysql_insert_id()"? > > I?m not to do a link between tables in PHPMyAdmin? > > > > Thank you very... VERY... much! > If you are using MySQL 4.1 or later you should use the mysqli extension and not the older mysql one. UNLESS you are relying on the older style passwords, which is a BAD idea. >> I dont know what version I use =S >> THANKS A LOT NEIL -- Niel Archer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php