所以這可能是愚蠢的,但我不能得到任何東西插入MySQL的某個帳戶,我一直在盯着這個兩個小時。我是PHP的新手,所以我很可能會做一些愚蠢的事情。我附上了我試圖插入的DB的屏幕截圖。爲什麼我不能插入?
這裏是我說的:
(imgur似乎已經爲我)
這裏是我的代碼,並phpMyAdmin的告訴我GRANT ALL PRIVILEGES ON 。 TO ...
$fbFirstName = $me['first_name'];
$fbLastName = $me['last_name'];
$fbEmail = $me['email'];
mysql_real_escape_string($fbFirstName,$fbLastName,$fbEmail);
$getuserresult = mysql_query("SELECT * FROM newusers WHERE fbUID=$uid");
$userrowsreturned=mysql_num_rows($getuserresult);
if ($userrowsreturned=0)
{
echo '<br />user already exists, will update something here eventually<br />';
}
else {
$sql = mysql_query("INSERT INTO newusers (fbUID,callsAttempted,callsMade,fbEmail,fbFirstName,fbLastName) VALUES ($uid,'1','0',$fbEmail,$fbFirstName,$fbLastName)");
if(!$sql) {
die("Nope");
} else {
echo "1 record added";
}
echo '<br />created user<br />';
}
你能死嗎(mysql_error())',而不是? – Matchu 2010-08-24 00:54:30