sean14592 Posted April 2, 2008 Share Posted April 2, 2008 Hi, I have a small problem, I keep getting sent to reg_account.php (which is an error page). I cant see anything wrong. Can anyone see anything? <?php ////INSERT ALL VARIABLES INTO DATABASE! $connect = mysql_connect($host,$username,$password) or die("Error connecting to Database!". mysql_error()); mysql_select_db($database,$connect) or die("cannot select database!".mysql_error()); $request= "INSERT INTO properties values(NULL,'$package','$email','$phone1','$phone2','$pname','$pcity','$pstate','$pcountry','$shortdesc','$shortdesc','$areadesc','$conditions','$changeday','$nearestbeach','$distbeach','$sleeps','$bedrooms','$car','$wheel','$pets','$child','$smoke','$tennis','$water,'$horse','$golf','$fishing','$cycling','$beach','$lake','$winter','$night','$cult','$sight','$events','$sport','$theme','$walk','$sea','$prigarden','$balc','$poolview','$tv','$sattv','$safe','$wifi','$kettle','$toast','$iron','$hair','$dish','$cook','$micro','$air','$log','$fridge','$freez','$wash','$bath','$suite','$shower','$wc','$bid','$sofa','$double','$twin','$single','$bunk','$cot','$high','$dining','$lounge','$linen','$prioutheat','$priinheat','$prioutun','$priinun','$shouheat','$shinhe','$shouun','$shinun','$shgarden','$pripark','$shpark','$sec24','$gym','$furthdetout','$furthdetin','$bath2','$suite2','$shower2','$wc2','$bid2','$sofa2','$double2','$twin2','$single2','$bunk2')"; $results = mysql_query($request); if($results) { header("Location: ./../reg_done.php"); //Sent to this page once reg conplete. } else { header("Location: ./../errors/reg_account.php"); //error } mysql_close($link); Die(); } ?> Cheers Sean ??? Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/ Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 At the very least, try and capture any error. $results = mysql_query($request) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507415 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Share Posted April 2, 2008 Parse error: syntax error, unexpected '}' in xxx on line 23... Try: <?php ////INSERT ALL VARIABLES INTO DATABASE! $connect = mysql_connect($host,$username,$password) or die("Error connecting to Database!". mysql_error()); mysql_select_db($database,$connect) or die("cannot select database!".mysql_error()); $request= "INSERT INTO properties values(NULL,'$package','$email','$phone1','$phone2','$pname','$pcity','$pstate','$pcountry','$shortdesc','$shortdesc','$areadesc','$conditions','$changeday','$nearestbeach','$distbeach','$sleeps','$bedrooms','$car','$wheel','$pets','$child','$smoke','$tennis','$water,'$horse','$golf','$fishing','$cycling','$beach','$lake','$winter','$night','$cult','$sight','$events','$sport','$theme','$walk','$sea','$prigarden','$balc','$poolview','$tv','$sattv','$safe','$wifi','$kettle','$toast','$iron','$hair','$dish','$cook','$micro','$air','$log','$fridge','$freez','$wash','$bath','$suite','$shower','$wc','$bid','$sofa','$double','$twin','$single','$bunk','$cot','$high','$dining','$lounge','$linen','$prioutheat','$priinheat','$prioutun','$priinun','$shouheat','$shinhe','$shouun','$shinun','$shgarden','$pripark','$shpark','$sec24','$gym','$furthdetout','$furthdetin','$bath2','$suite2','$shower2','$wc2','$bid2','$sofa2','$double2','$twin2','$single2','$bunk2')"; $results = mysql_query($request); if($results) { header("Location: ./../reg_done.php"); //Sent to this page once reg conplete. } else { header("Location: ./../errors/reg_account.php"); //error mysql_close($link); Die(); } ?> ~ Thomisback Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507433 Share on other sites More sharing options...
sean14592 Posted April 2, 2008 Author Share Posted April 2, 2008 Hi, yet another error. I keep getting the following... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'horseyes','golfno','fishingyes','fishingno','beechyes','lakeyes','wintersunyes',' at line 1 This is the code.... <?php ////INSERT ALL VARIABLES INTO DATABASE! $connect = mysql_connect($host,$username,$password) or die("Error connecting to Database!". mysql_error()); mysql_select_db($database,$connect) or die("cannot select database!".mysql_error()); $request= "INSERT INTO properties values(NULL,'$package','$email','$phone1','$phone2','$pname','$pcity','$pstate','$pcountry','$shortdesc','$shortdesc','$areadesc','$conditions','$changeday','$nearestbeach','$distbeach','$sleeps','$bedrooms','$car','$wheel','$pets','$child','$smoke','$tennis','$water,'$horse','$golf','$fishing','$cycling','$beach','$lake','$winter','$night','$cult','$sight','$events','$sport','$theme','$walk','$sea','$prigarden','$balc','$poolview','$tv','$sattv','$safe','$wifi','$kettle','$toast','$iron','$hair','$dish','$cook','$micro','$air','$log','$fridge','$freez','$wash','$bath','$suite','$shower','$wc','$bid','$sofa','$double','$twin','$single','$bunk','$cot','$high','$dining','$lounge','$linen','$prioutheat','$priinheat','$prioutun','$priinun','$shouheat','$shinhe','$shouun','$shinun','$shgarden','$pripark','$shpark','$sec24','$gym','$furthdetout','$furthdetin','$bath2','$suite2','$shower2','$wc2','$bid2','$sofa2','$double2','$twin2','$single2','$bunk2')"; $results = mysql_query($request) or die(mysql_error()); if($results) { header("Location: ./../reg_done.php"); //Sent to this page once reg conplete. } else { header("Location: ./../errors/reg_account.php"); //error } mysql_close($link); Die(); } ?> Cheers Sean Sorry to be a bother. lol Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507453 Share on other sites More sharing options...
uniflare Posted April 2, 2008 Share Posted April 2, 2008 did you look over your query? you missed a single quote somwhere, ill let you find it Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507459 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Share Posted April 2, 2008 Heheh, I can't find it but I will check again and let you know whether I found it. Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507463 Share on other sites More sharing options...
sean14592 Posted April 2, 2008 Author Share Posted April 2, 2008 Hi, im not missing any ' in the following $request= "INSERT INTO properties values(NULL,'$package','$email','$phone1','$phone2','$pname','$pcity','$pstate','$pcountry','$shortdesc','$shortdesc','$areadesc','$conditions','$changeday','$nearestbeach','$distbeach','$sleeps','$bedrooms','$car','$wheel','$pets','$child','$smoke','$tennis','$water,'$horse','$golf','$fishing','$cycling','$beach','$lake','$winter','$night','$cult','$sight','$events','$sport','$theme','$walk','$sea','$prigarden','$balc','$poolview','$tv','$sattv','$safe','$wifi','$kettle','$toast','$iron','$hair','$dish','$cook','$micro','$air','$log','$fridge','$freez','$wash','$bath','$suite','$shower','$wc','$bid','$sofa','$double','$twin','$single','$bunk','$cot','$high','$dining','$lounge','$linen','$prioutheat','$priinheat','$prioutun','$priinun','$shouheat','$shinhe','$shouun','$shinun','$shgarden','$pripark','$shpark','$sec24','$gym','$furthdetout','$furthdetin','$bath2','$suite2','$shower2','$wc2','$bid2','$sofa2','$double2','$twin2','$single2','$bunk2')"; ummm, still unsolved. anyone find anything? Cheers Sean Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507466 Share on other sites More sharing options...
Thomisback Posted April 2, 2008 Share Posted April 2, 2008 Found it: '$water,'$horse' Should be '$water','$horse' ~ Thomisback Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507470 Share on other sites More sharing options...
trq Posted April 2, 2008 Share Posted April 2, 2008 Sean, can you please stop opening new threads for what is essentually the same subject. Merged. Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507474 Share on other sites More sharing options...
sean14592 Posted April 2, 2008 Author Share Posted April 2, 2008 oh, soz mate. I didnt realise u replied to solved threads. Wont do again. p.s. great site, most designers/programs cant be assed. but u guys are great. Cheers Sean Link to comment https://forums.phpfreaks.com/topic/99179-solved-mysql-problem/#findComment-507478 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.