DrTrans Posted October 16, 2009 Share Posted October 16, 2009 <?php $fname = $_GET['fname']; $lname = $_GET['lname']; $slname = $_GET['slname']; $submit = $_GET['submit']; $title = $_GET['title']; $region = $_GET['region']; $key = $_GET['key']; $skey = $_GET['skey']; $date = date("F j, Y, g:i a"); if($title){ echo "$title"; $connect = mysql_connect("localhost","damgears_evil","damgears"); mysql_select_db("damgears_evil"); $queryb = mysql_query("INSERT INTO titles VALUES ('','$fname','$lname','$key','$slname','$skey','$date','$title','$region'"); } else echo"Problem.. Check Database"; ?> I dont understand why its not inserting the line in the database. Link to comment https://forums.phpfreaks.com/topic/177953-solved-please-help-i-cant-find-the-error/ Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 Most like a query failure... to find out what it might be... mysql_query("INSERT INTO titles VALUES ('','$fname','$lname','$key','$slname','$skey','$date','$title','$region'") or trigger_error(mysql_error, E_USER_ERROR); Link to comment https://forums.phpfreaks.com/topic/177953-solved-please-help-i-cant-find-the-error/#findComment-938270 Share on other sites More sharing options...
mrMarcus Posted October 16, 2009 Share Posted October 16, 2009 you're not telling the query where to insert those values. insert into `titles` ??? no field names to follow .. you need to indicate field names. and just stating "i can't find the error" with a hidden blurb about what the issue is, is not the best way to get people's help. Link to comment https://forums.phpfreaks.com/topic/177953-solved-please-help-i-cant-find-the-error/#findComment-938271 Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 you're not telling the query where to insert those values. insert into `titles` ??? no field names to follow .. you need to indicate field names. Field names aren't a requirement, it should work without them. Having said that the most like problem assume the OP doesn't have the wrong column cound or one of the values isn't string is that it doesn't like sending '' to an auto increment field. Some versions of MySQL allow it, some don't. and just stating "i can't find the error" with a hidden blurb about what the issue is, is not the best way to get people's help. Couldn't agree more. Link to comment https://forums.phpfreaks.com/topic/177953-solved-please-help-i-cant-find-the-error/#findComment-938294 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.