Re: If( Query)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <php@xxxxxxxxxxxxxxx> wrote:
> 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','$item_price','$item_man_id','$item_cat_id')";
>   }
>   else {
>       $sql = "INSERT INTO items
> (item_name,item_desc,item_price,item_pix,item_man_id,item_cat_id) VALUES
> ('$item_name','$item_desc','$item_price','$item_pix','$item_man_id','$item_cat_id')";
>   }
>   mysql_query($sql);
>   return;
> }
>
> I am using the if statement because i want it so that if no picture is
> uploaded the entry is blank and the mysql database has a default entry of
> na.gif which is a "picture coming soon picture".
>
> It works fine when i run in localy on MAMP, but if i run it on my web server
> it doesnt add the row.
>
> Is this a compatability error? or is there a better way to write this?
>
> Thanks
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux