ivannovak / jpmaster77-s-Login-System-

jpmaster77's Login System v2.0.4d
http://www.evolt.org/node/60384
Other
42 stars 28 forks source link

Adding SQL table #17

Open hOlyYy opened 12 years ago

hOlyYy commented 12 years ago

Greetings,

i've been trying to add sql table sid into users but after i do, I can't register, unexpected error. Any hints how to fix this?

Mark-Artyniuk commented 11 years ago

I know this question is old, but its a good one to have answered here somewhere.

/includes/database.php

the addNewUser function uses a method to insert data that needs to manually edited if you add a field to the users table.

Since nothing is specified you must have a value for each field. If you dont add a value to this insert (below), it will fail.

   $q = sprintf("INSERT INTO ".TBL_USERS." VALUES ('%s', '%s', '%s', '%s', '%s', $time, '1', '0', '%s', '0', '0')",
        mysql_real_escape_string($username),
        mysql_real_escape_string($password),
        mysql_real_escape_string($userid),
        mysql_real_escape_string($ulevel),
        mysql_real_escape_string($email),
        mysql_real_escape_string($name));
  return mysql_query($q, $this->connection);