chriscloyd Posted October 21, 2009 Share Posted October 21, 2009 i have this code below and nothing shows up not even the else statements <?php error_reporting(E_ALL); $connect = mysql_connect("localhost","**********","**********") or die(mysql_error()); if ($connect) { $select = mysql_select_db("site") or die(mysql_error()); if ($select) { $test = mysql_query("INSERT INTO `site`.`quotes` (`id`, `name`, `email`, `phone`, `type`, `budget`, `start`, `info`, `ip`, `time`) VALUES (NULL, \'1\', \'1\', \'1\', \'1\', \'1\', \'1\', \'1\', \'1\', \'1\')" or die(mysql_error()); if($test) { echo 'yes'; } else { echo 'no'; } } else { echo "couldnt find db"; } } else { echo "couldnt find server"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/ Share on other sites More sharing options...
mikesta707 Posted October 21, 2009 Share Posted October 21, 2009 none of the else statements show up at all? I don't see how thats possible. do you get an error? make sure you turn error reporting on Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940836 Share on other sites More sharing options...
chriscloyd Posted October 21, 2009 Author Share Posted October 21, 2009 no error at all AT ALL and error reporting is on Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940841 Share on other sites More sharing options...
mikesta707 Posted October 21, 2009 Share Posted October 21, 2009 if this is all the code you have, than that should work. it should at least display something (since you have your dies, and elses) Is there any more code? Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940852 Share on other sites More sharing options...
chriscloyd Posted October 21, 2009 Author Share Posted October 21, 2009 nope thats all the code and when i run the page nothing at all shows up doesnt go into my database i have been coding for a long time hahah and this has never happened to me Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940854 Share on other sites More sharing options...
mikesta707 Posted October 21, 2009 Share Posted October 21, 2009 hmm then maybe there is something wrong with your PHP configuration, try echoing something before all the code, and see if it echos Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940858 Share on other sites More sharing options...
chriscloyd Posted October 21, 2009 Author Share Posted October 21, 2009 it echos Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940860 Share on other sites More sharing options...
PFMaBiSmAd Posted October 21, 2009 Share Posted October 21, 2009 The posted code contains a fatal parse error because of a missing ) on the mysql_query(... statement. Putting error_reporting/display_error settings in your script won't help show fatal parse errors because your code is never executed. You should be developing php code and debugging php code on a system with error_reporting/display_errors set in your php.ini. When we suggest putting lines of code in to set those two settings in your code, it is to debug code that is at least doing something/being executed. Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940861 Share on other sites More sharing options...
chriscloyd Posted October 21, 2009 Author Share Posted October 21, 2009 wow i feel so stupid haha thanks Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940862 Share on other sites More sharing options...
mikesta707 Posted October 21, 2009 Share Posted October 21, 2009 oh totally didnt scroll over, nice catch Quote Link to comment https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/#findComment-940870 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.