Re: [PHP] Add data to three tables at once from one form

2001-04-20 Thread Godd
you have the idea. Just add the other sql statements and run it again. (Just multiply the script by 3) or you can use a loop to add the next sql to run eg. $sql1= "insert statement 1"; $sql2="insert statement 2"; $sql3= "insert statement 3"; for ($i=0; $i<3; $i++) { $qryno = '$sql' + $i $res

Re: [PHP] Add data to three tables at once from one form

2001-04-20 Thread Steve Werby
"Julian Wood" <[EMAIL PROTECTED]> wrote: > > That's it. There's nothing special to do. > > Except if one insert fails and the others succeed, you run into a bit of > sync trouble. This is what transactions are for. You might want to consider > a BDB table type, which supports transactions, then y

Re: [PHP] Add data to three tables at once from one form

2001-04-19 Thread Julian Wood
> That's it. There's nothing special to do. Except if one insert fails and the others succeed, you run into a bit of sync trouble. This is what transactions are for. You might want to consider a BDB table type, which supports transactions, then you have the option to rollback the other inserts

RE: [PHP] Add data to three tables at once from one form

2001-04-18 Thread Jason Murray
> Add two more sets of statements like those you have for the > first query. That's it. There's nothing special to do. MySQL also lets you stack insert statements: $sql="INSERT INTO t1 ('A'); INSERT INTO t2 ('B'); INSERT INTO t3 ('C');" This would work (but if you get an error, you'll have tr

Re: [PHP] Add data to three tables at once from one form

2001-04-18 Thread Steve Werby
"Fates" <[EMAIL PROTECTED]> wrote: > I know how to add data to one table but how do I add data to three > tables from one form? > > I want to do this with just one form and on one web page so it doesn't > post to another page. > > How do I set up the insert statement? > >$query = "INSERT INTO