I keep getting "You have an error in your SQL syntax", event if the query runs ok by it's own.
The code :
function CreateUser(){
$token = md5(uniqid(rand(),true));
$query = "USE carshop;
INSERT IGNORE INTO users VALUES(
'',
'$GLOBALS[nume]',
'$GLOBALS[pren]',
'$GLOBALS[mail]',
'$GLOBALS[adresa]',
'$GLOBALS[parola]',
'$token',
'0',
'0',
'');";
echo $query;
mysql_query($query)or die("Error: ".mysql_error());
break;
}
Echo query : INSERT IGNORE INTO users VALUES( '', 'test1', 'test2', 'dididid@dd.com', 'dsads llaowd sda', '6ccee2f5b01591f6644036c1114b5b4f', '8b3cc272280f13d765b271e203124308', '0', '0', '');
And the DB structure is :
CREATE TABLE users (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`nume` CHAR(20) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci',
`prenume` CHAR(20) NOT NULL COLLATE 'utf8_unicode_ci',
`mail` VARCHAR(30) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci',
`adresa` TEXT NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci',
`parola` VARCHAR(100) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci',
`token` VARCHAR(100) NOT NULL DEFAULT '0' COLLATE 'utf8_unicode_ci',
`isVerified` INT(1) NOT NULL DEFAULT '0',
`isOnline` INT(1) NOT NULL DEFAULT '0',
`dateCreated` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
Thanks, and sorry if i'm doing any newbie mistakes, i'm new at this