updating mysql tables with php

Codes here !

Moderators: macek, egami, gesf

andz1982
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Oct 29, 2012 8:00 am

updating mysql tables with php

Postby andz1982 » Tue Mar 05, 2013 3:37 am

HI There...

Got a little problem with updating mysql tables...
I have an item that is already in the database (ex. object1) with a product code listed: What i want to do is insert the quantity of items taken of that specific product (the values are being posted from a form; the form is posting just fine but when it comes to actually updating the table it gives an error.

here's an example of what i mean:
(as i mentioned earlier the values are being posted from another form

$sql = mysql_query ("UPDATE products SET quantity_taken=$productquantity1; WHERE product_code='$productcode1'") or die ("UNABLE TO COMPLETE");

(also i want to update the date which is also being posted from another form)
I would really appreciate any help you could give me....


Thanks a lot.

andz1982
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Oct 29, 2012 8:00 am

Re: updating mysql tables with php

Postby andz1982 » Tue Mar 05, 2013 3:48 am

update.....fixed the problem....small syntax error

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: updating mysql tables with php

Postby seandisanti » Wed Mar 06, 2013 3:06 pm

Good job! Thanks for letting everyone know you resolved the issue also, so we don't go wasting our time suggesting things; if you could though, writing the solution, even if it's just the error you were getting and what was causing it, would help others who may be searching for help with the same error message.


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 2 guests

cron