Forum Moderators: coopster
Here is the last re-write of my code:
$SQL = mysql_query("SELECT * FROM account WHERE login ='".$login."'");
$result = mysql_fetch_array($SQL, $conn);
$acct_id = $result['id'];
$insertSQL = "INSERT INTO character VALUES ('', '$acct_id', '$charname', '', '', '', '', '', '', '', '', '', '', '', '', '', '$cityname', '', '')";
$rs = mysql_query($insertSQL,$conn);
if($rs){
echo '&result=success&';
}else{
echo '&result=failure&';
}
Any help would be greatly appreciated!
MM
btw, you really should escape all the data you send to mysql ... it'd be easy to inject something into your sql, since most of the data is probably user-generated.
ah, now I see it. I think, character is a reserved word. write it in backicks (`) and you should be fine.