On 26-Feb-2003 Andrew Maynes wrote:
> problably a silly question but if I am updating a table in a MySQL DB with a
> table structure like this:
> 
>  TABLE xxx
>   ItemSKU
>   ItemName
>   ItemDescription
>   PostCode
>   Category
>   CityID
>   CTelephone
>   ItemID
>   Cfax
>   Cemail
>   Caddress
>   CTown
>   Cwww
>   PRIMARY KEY (ItemID)
> 
> and the update query is this:
> 
> mysql_connect("$DBHost","$DBUser","$DBPass");
> mysql("$DBName","UPDATE items
> SET ItemSKU='$ItemSKU',
> ItemName='$ItemName',
> ItemDescription='$ItemDescription',
> PostCode='$PostCode',
> Category='$Category',
> CityID='$CityID'
> CTelephone='$CTelephone'
> Cfax='$Cfax'
> Cemail='$Cemail'
> Caddress='$Caddress'
> Cfax='$CTown'
> Cwww='$Cwww'
> WHERE ItemID='$ItemID'");
> 
> 
> is there any reason why it would not work???
> 

Other than function 'mysql()' --MYM 'mysql_query()' ?

I can't tell from here, try using some error checking and basic debuging:

mysql_connect("$DBHost","$DBUser","$DBPass") 
 or die("Could not connect: " . mysql_error());

$qry="UPDATE items SET ItemSKU='$ItemSKU', ...<sniptherest>";
echo '<P>', $qry, '<P>';

$res = mysql_query($qry)
    or die("Invalid query: " . mysql_error());


> Cheers
> Andrew
> 

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to