lordphate Posted November 8, 2006 Share Posted November 8, 2006 Okay I know this is probably REALLY simple but i'm having this error:INSERT INTO photo_comments_profile (mem_id,pho_id,comment,date,author) VALUES (100079,100098,'sdg',NOW(),Brandon):Unknown column 'Brandon' in 'field list'I know that means somethings up with my SQL...so here's that piece[code]$info = auth_member(); $values = form_handle_input("photo_comment"); $sql_query = "INSERT INTO photo_comments_profile (mem_id,pho_id,comment,date,author) VALUES (:mem_id:,:pho_id:,':comment:',NOW(),".$info["fname"].")"; $vals["mem_id"] = $info["mem_id"]; $vals["pho_id"] = $values["pho_id"]; $vals["comment"] = $values["comment"]; $vals["date"] = $values["date"]; $vals["fname"] = $info["fname"];[/code] Quote Link to comment Share on other sites More sharing options...
Skatecrazy1 Posted November 8, 2006 Share Posted November 8, 2006 very messy here:[code](:mem_id:,:pho_id:,':comment:',NOW(),".$info["fname"].")";[/code] Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted November 8, 2006 Share Posted November 8, 2006 Enclose your last value for the sql statement in single quotes. Don't forget to escape the string. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.