Re: error in insert function
| From: | toby z | Date: | Mon, 19 May 2003 13:20:33 +0000 |
| Subject: | Re: error in insert function | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20001@lists.php.net to get a copy of this message | ||
hay A
try this for your insert query
INSERT INTO invoice
(loc_id, lev_date, wm_id, payroll_no, line_text, price,
amount)
VALUES
('".$loc_id."', '". '$lev_date'."', '".
'$wm_id'."', '".
$payroll_no."', '". '$line_text'."',
'".$price."', '".$amount."')";
hope this helps
good luck
toby
--- "A. Mikkelsen" <a__mikkelsen@hotmail.com> wrote: > Hi
>
> I'M stuck
>
> Can anyone help.
>
> I'm trying to call a function :
>
> $lev_date = '190303';
>
>
add_menu_db($location,$lev_date,$wm_id,$payroll_no,$order_menu[0]['text'],$o
> rder_menu[0]['price'],$amount);
>
> The function :
>
> function
>
add_menu_db($loc_no,$lev_date,$wm_id,$payroll_no,$line_text,$price,$amount)
> {
> global $db1;
> $q = "
> INSERT INTO invoice
> (loc_id, lev_date, wm_id, payroll_no, line_text, price,
> amount)
> VALUES
> ($loc_id, '$lev_date', '$wm_id', $payroll_no, '$line_text',
> $price,
> $amount)
> ";
> mysql_query($q,$db1) or die ("ERROR IN - add_menu_db function");
> }
>
> I get a error but it works if in a promt writes :
>
> INSERT INTO invoice
> (loc_id, lev_date, wm_id, payroll_no, line_text, price,
> amount)
> VALUES
> (1, "190303", "wmtester", 19999, "text", 10 ,2)
>
>
> CAN ANYONE HELP ?????????+
> _____________________________
> Anders Mikkelsen
> A. Mikkelsen
> Telefon +45 21717224
> mailto:am@amikkelsen.com
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer