[PHP/MYSQL]Query isn't working
PHP Code:
$sql = "INSERT INTO sso (name,ticket) VALUES ('$nick','$ticket')";
if (!mysql_query($sql,$conectar))
{
die('Error: ' . mysql_error());
}
It should work, and I know the variables are correct, but it dosen't insert the data. It used to work, but it's gone and given up the ghost. Any ideas?
Re: [PHP/MYSQL]Query isn't working
im sorry man but nobody will be able to help if you dont show the whole file or the other variables. something like
Code:
$sql = "INSERT INTO sso (name,ticket) VALUES ('$nick','$ticket')";
if (!mysql_query($sql,$conectar))
{
die('Error: ' . mysql_error());
}
wont help
Re: [PHP/MYSQL]Query isn't working
Re: [PHP/MYSQL]Query isn't working
Care to explain what the problem was and how you fixed it?
Re: [PHP/MYSQL]Query isn't working
The query in itself is valid if the table sso exists and has columns name and ticket. There could've been a dozen things wrong, but I'm guessing it's a malfunctioning database connection or a filled up logfile. Doubt we'll ever know now though :tongue:
Re: [PHP/MYSQL]Query isn't working
I got it to work by clearing the SSO table of all it's previous data, since it gets a new INSERT query everytime you login with this php, and reduced the php to merely:
Quote:
mysql_query("insert into sso (name,ticket) values ('$nick','$ticket')") ;