|
Posted by Mr. Newt on 04/07/07 03:52
"ZeldorBlat" <zeldorblat@gmail.com> wrote in message
news:1175913519.299306.232510@d57g2000hsg.googlegroups.com...
> On Apr 6, 8:45 pm, "Mr. Newt" <lektrikpuke@_yahoo.com> wrote:
>> 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
>
> The second line should be .= As it is now the second query is simply
> replacing the first one before you even run it.
>
> When faced with problems like this echo out the value of $sql first to
> make sure it has what you think it does.
>
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?
Navigation:
[Reply to this message]
|