Hey I'm tring the following sql query :
$sql = mysql_query("INSERT INTO feeds (FileLocation,Title,feeddate,nameofuploader,type)
VALUES('".mysql_real_escape_string($putItAt)."','".mysql_real_escape_string($_POST['title'])." ',now(),". $_SESSION['name'] .",'file')")
but its giving me the error:
Unknown column 'Ankit2' in 'field list'
where Ankit2 is the value to be inserted
Any way around this?
Answer
You forgot to put single quotes around the $_SESSION variable!
$sql = mysql_query("INSERT INTO feeds (FileLocation,Title,feeddate,nameofuploader,type)
VALUES('".mysql_real_escape_string($putItAt)."','".mysql_real_escape_string($_POST['title'])." ',now(),'". $_SESSION['name'] ."','file')")
No comments:
Post a Comment