|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Inserting into two tables at one click
Hello
I want to insert some data into 2 of my tables through my PHP form.How can i do it? For example, field1, field2 should be inserted into table 1 and field3, field4 should be inserted into table 2. I'm able to insert into one table but not into 2 tables simultaneously. Any help?? Thank you |
|
#2
|
|||
|
|||
|
RE: Inserting into two tables at one click
The easy way is to have 2 querys...
be well |
|
#3
|
|||
|
|||
|
RE: Inserting into two tables at one click
hehe, yeah, why do you need to insert into 2 tables simultaneously anyhow?
|
|
#4
|
|||
|
|||
|
RE: Inserting into two tables at one click
Yes, maybe your table has not a good structure ?
Let us help.. |
|
#5
|
|||
|
|||
|
RE: Inserting into two tables at one click
try "INSERT into table1, table2 VALUES(table1.field1='', table1.field2='', table2.field3='', table2.field4='')"
never tested it with multiple tables, but should work IMO |
|
#6
|
|||
|
|||
|
RE: Inserting into two tables at one click
Doesn't work, i tried it with INSERT INTO users, notes (notes.id, users.id) VALUES (1000, 1000) and it had a problem from the , notes part if i remember correctly..
|
|
#7
|
|||
|
|||
|
RE: Inserting into two tables at one click
try this
mysql_query("INSERT into table1 VALUES(field1='', field2=''"); mysql_query("INSERT into table2 VALUES( table2.field3='', table2.field4=''"); that will work |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Inserting into two tables at one click |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|