update specific column

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
simplypixie
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire
Contact:

Re: update specific column

Post by simplypixie » Mon Oct 22, 2012 2:46 am

You only use SET once in a query, you are formatting your surrounding quote marks incorrectly and you are missing your commas so change your query to this and it should work (subject to anything else that may be wrong)

Code: Select all

$sql = "UPDATE mymovie SET
       mw_url = ' " . $mw_url . " ',
       mw_quality = ' " . $mw_url  . " ',
       mw_size = ' " . $mw_url . " ',
       mw_filetype = ' " . $mw_url . " '
       WHERE id = ' " . $id . ' ";
Don't forget to sanitzie your input as well (mysql_real_escape_string)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 5 guests