RE: Newbie MySQL INSERT Q
| From: | Uttam | Date: | Sat, 15 Mar 2003 07:15:05 +0000 |
| Subject: | RE: Newbie MySQL INSERT Q | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139783@lists.php.net to get a copy of this message | ||
PHP does not allow ';' character in query strings so you'll have to break
these.
regds,
-----Original Message-----
From: Charles Kline [mailto:ckline@rightcode.net]
Sent: Friday, March 14, 2003 20:34
To: php-general@lists.php.net
Subject: Newbie MySQL INSERT Q
Can I have a single SQL string do INSERTS into multiple tables?
Like:
sql="INSERT INTO tbl_1 (id,
email_address_1)
VALUES ($v_personid,
'$v_email');
INSERT INTO tbl_2 (person_id,
interest_id)
VALUES ($v_personid,
$v_int1);";
Or do I need to break them up and use two of these?
$result = $db->query($sql)
Thanks
Charles