You are here: Re: inserting data into multiple tables at the same time « PHP Language « IT news, forums, messages
Re: inserting data into multiple tables at the same time

Posted by peter on 04/07/07 04:12

> I must be tired. I accidentally replied to Zeldor instead of the NG.
> Sorry Zeldor.
>
> Any way, I've tried replacing = with .= and it still doesn't work. I've
> tried every
> variation I can come up with and no joy. Another hint?

As Zeldor pointed out you must use .= otherwise the second query would
overwrite the first query in the variable. Also even if you did it correctly
the sql would be:-

INSERT INTO advertiser_info_tbl (adv_name) values ('$adv_name')INSERT INTO
address_info_tbl (address, apt, city, state, zip) values ('$address','$apt',
'$city', '$state', '$zip')

But obviously with the variables replaced. In this example how does mysql
know this is 2 statements? In fact it does not you should terminate a
statement with a ;.

1 other problem however if I remember correctly mysql_query can only handle
1 query at a time if you try more than 1 it will fail. I beleive
mysqli_query can handle 2 however.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация