Jump to content

Registration Errors


wro

Recommended Posts

Hello all, new to the site and new(ish) to php.  I'm attempting to get a registration going for a php game, but it's returning an error.  It's returning "could not register" 

 

Thanks in advance to any ideas =D

 

      $password=md5($password);
      $date=round(date("U")/1000);
      srand($date);
      $thekey=rand(1,100000000);
      $thekey=md5($thekey);
      $SQL = "INSERT into wr_users(playername, password, email, str, end, int, luck, dead, turns, gold, validated, validkey) VALUES ('$player', '$password', '$email', '3', '3', '3', '3', '0', '20', '12', '0', '$thekey')"; 
      mysql_query($SQL) or die("could not register");

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/202243-registration-errors/
Share on other sites

At least 'int' is a reserved mysql keyword (there is a table of reserved words in the mysql manual.) You either need to rename your int column to something else or enclose it in back-ticks `` every time you use it in a query.

 

Damn, can't believe I didn't notice that.

Link to comment
https://forums.phpfreaks.com/topic/202243-registration-errors/#findComment-1060501
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.