Help with Updating MySQL record

  • natas
  • PHP Ninja
  • Proficient
  • No Avatar
  • Joined: Mar 28, 2009
  • Posts: 305
  • Loc: AFK
  • Status: Offline

Post June 24th, 2010, 6:26 pm

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.
Custom Web Design
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 24th, 2010, 6:26 pm

  • natas
  • PHP Ninja
  • Proficient
  • No Avatar
  • Joined: Mar 28, 2009
  • Posts: 305
  • Loc: AFK
  • Status: Offline

Post June 24th, 2010, 7:16 pm

EDIT:
Nevermind.... I got it to work. I had the variable names all mussed up. Sorry.
Custom Web Design
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post June 24th, 2010, 7:37 pm

You're using double quotes for that last variable.
#define NULL (::rand() % 2)

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 310 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.