32
Monty, your code will not work because the values in between the quotes are not translated, the value stored in the database would actually be $uname for the username instead of wtravel.
The reason why it did not work is that there were too many quotes in my last post
. Instead of the above solution, try this sql statement. I would like to add Monty's suggestion of using the trim() function which strips off any whitespaces from the values.
$uname = "'".trim($newuser->getvar('uname'))."'";
$pass = "'".trim($newuser->getvar('pass'))."'";
$email = "'".trim($newuser->getvar('email'))."'";
$sql = sprintf("INSERT INTO %s (login, email, password) VALUES (%s, %s, %s)", 'pcpin_user', $uname, $email, $pass);