excape your variables like so in your insert statement - ' $a_row[p_company]
' (quick and dirty style),
or the clean way  ".$a_row['p_company'] ."


"Angelo Zanetti" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> HI all I have a Select that get a resultset, once I get this then I use
the
> values of this resultset to enter them into another table using an INSERT
> statement. I get no errors from the statement but it just doesn't seem to
> see my variables from the recordset,
>
> below is my code:
>
>
>
> $q="select * from prospects where p_id = '$p_id'";
> $result=mysql_query($q, $this->link) or die ("".mysql_error());
>
> while($a_row=mysql_fetch_array($result))
> {
> $c_query="Insert into client (c_name, c_company, c_worktel, c_directtel,
> c_hometel, c_fax, c_cell, c_email, c_address, c_city, c_pcode, c_country)
> VALUES ($a_row['p_name'], $a_row['p_company'], $a_row['p_worktel'],
> $a_row['p_directtel'], $a_row['p_hometel'], $a_row['p_fax'],
> $a_row['p_cell'], $a_row['c_email'], $a_row['c_address'],
$a_row['c_city'],
> $a_row['c_pcode'], $a_row['c_country'])";
> mysql_query($c_query,$this->link) or die ("".mysql_error());
> }
>
> I echo'd out the values from the Select just to make sure it was getting
the
> correct values.
>
> any help will be appreciated, thanx in advance
>
> Angelo
>
> --------------------------------------------------------------------
> Disclaimer
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is
> intended for the attention and use only of the addressee.
> Should you have received this e-mail in error, please delete
> and destroy it and any attachments thereto immediately.
> Under no circumstances will the Cape Technikon or the sender
> of this e-mail be liable to any party for any direct, indirect,
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to