Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
all of us do, it's subscribed to the list. i filter it out. On Mon, Sep 8, 2008 at 7:06 PM, Chris Hale <[EMAIL PROTECTED]> wrote: > Evert Lammerts wrote: >> >> My bad! Forgot the dollar signs This should work: >> function editproduct($item_id, $item_name, $item_desc, $item_price, >> $item_pix,

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
Do a print on the query: >> function editproduct($item_id, $item_name, $item_desc, $item_price, >> $item_pix, $item_man_id, $item_cat_id) { >>$item_id = mysql_real_escape_string($item_id); >>$item_name = mysql_real_escape_string($item_name); >>$item_desc = mysql_real_escape

Re: [PHP-DB] If( Query)

2008-09-08 Thread Evert Lammerts
You need to run mysql_real_escape_string() on all of your input variables before using them: function editproduct($item_id, $item_name, $item_desc, $item_price, $item_pix, $item_man_id, $item_cat_id) { $item_id = mysql_real_escape_string($item_id); $item_name = mysql_real_escape_st

Re: [PHP-DB] If( Query)

2008-09-08 Thread Chris Hale
Niel Archer wrote: Hi I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == "") { $sql = "INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALU

Re: [PHP-DB] If( Query)

2008-09-07 Thread Chris Hale
Niel Archer wrote: Hi I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == "") { $sql = "INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALU

Re: [PHP-DB] If( Query)

2008-09-07 Thread Niel Archer
Hi > I have the following function: > > function > add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) > { > connect(); > if($item_pix == "") > { > $sql = "INSERT INTO items > (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES >

Re: [PHP-DB] If( Query)

2008-09-07 Thread Evert Lammerts
Is your table set up in the same way on your webserver? Maybe you forgot to set the default value to na.gif in your item_pix column. If not, can you send your table definition? On Sat, Sep 6, 2008 at 9:02 PM, Chris Hale <[EMAIL PROTECTED]> wrote: > I have the following function: > > function > add

[PHP-DB] If( Query)

2008-09-06 Thread Chris Hale
I have the following function: function add_item($item_name,$item_desc,$item_price,$item_man_id,$item_cat_id,$item_pix) { connect(); if($item_pix == "") { $sql = "INSERT INTO items (item_name,item_desc,item_price,item_man_id,item_cat_id) VALUES ('$item_name','$item_desc','$