Hi,

did you "echo $query;" and put the output into phpmyadmin?
Perhaps there's an error message that may help you....

HTH,
Bastian

Steve Jackson schrieb:

> It doesn't work in that it doesn't update the database.
> I have a form which when loaded takes a variable ItemCode from the
> previous page (which gets the Itemcode from the DB) and puts it into a
> hidden field which I call oldItemCode, then when I try to update the
> $ItemCode row in the database with the edited changes using the
> oldItemCode as an identifier it won't update - It goes to my error
> message shown below. So what I'm asking is there anything I'm doing
> wrong. I noted your points about the comma and have changed the code.
>
> <?
>     $query = "update products
>              set ItemCode='$ItemCode',
>              ItemName ='$ItemName',
>              catid ='$catid',
>                          price = '$price',
>              description = '$description',
>                          shortdesc = '$shortdesc',
>              where ItemCode='$oldItemCode'";
>         $result = mysql_query($query);
> if (!$result)
>         {
>         echo "<table width='100%' border='0' cellspacing='0'
> cellpadding='0' align='center' bgcolor='#629D39'>";
>         echo "<tr><td><img
> src='images/admin_orders_administrate.gif'></td></tr>";
>         echo "<tr><td>&nbsp;</td></tr>";
>         echo "<tr><td><span class='adminisoleipa'>Could not change
> details: please <a href='mailto:[EMAIL PROTECTED]'>click
> here</a> to email the administrator<br><br></span>";
>         echo "</td>";
>         echo "</tr>";
>         echo "</table>";
>         }
> else
>         {
>         echo "<table width='100%' border='0' cellspacing='0'
> cellpadding='0' align='center' bgcolor='#629D39'>";
>         echo "<tr><td><img
> src='images/admin_orders_administrate.gif'></td></tr>";
>         echo "<tr><td>&nbsp;</td></tr>";
>         echo "<tr><td><span class='adminisoleipa'>Your product has been
> successfully edited<br><br></span>";
>         echo "</td>";
>         echo "</tr>";
>         echo "<tr>";
>     echo "<td>";
>         echo "<a href='eshop_uploadproductpicture.php'><img
> src='images/admin_orders_upload.gif' border='0'></a>";
>         echo "</td></tr>";
>         echo "</table>";
>         }
> ?>


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

Reply via email to