Help with Updating MySQL record

  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

I'm trying to update a mysql record using a variable. I don't know what I'm doing wrong.

Here's the code I've got typed up.

Code: [ Select ]
        mysql_query("SELECT * FROM tow_info");
        mysql_query("UPDATE tow_info SET origin='$origin', destination='$dest', WHERE fk_boat_name='$name'");
  1.         mysql_query("SELECT * FROM tow_info");
  2.         mysql_query("UPDATE tow_info SET origin='$origin', destination='$dest', WHERE fk_boat_name='$name'");


If I replace the variables with numbers, it works just fine so I'm confused. Any help would be appreciated.
  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

EDIT:
Nevermind.... I got it to work. I had the variable names all mussed up. Sorry.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

You're using double quotes for that last variable.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 68 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.