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

Posted by Mr. Newt on 04/07/07 00:45

Hi y'all,

I wrote the following:

<?php
include ("connect.php");
$sql = "INSERT INTO advertiser_info_tbl (adv_name) values ('$adv_name')";
$sql = "INSERT INTO address_info_tbl (address, apt, city, state, zip) values
('$address',

'$apt', '$city', '$state', '$zip')";
if (mysql_query($sql, $conn)){
echo "record added!";
} else {
echo "something went wrong";
}
?>

This seems to work with no error messages. Unfortunately, it doesn't put
any data into the first table (advertiser_info_tbl). It only puts data in
the second table. Is this possible? I've seen that you can retrieve data
from multiple tables at the same time, so I figure there must be a way.

Any help would be appreciated.

Robert

 

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

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