Jump to content

[SOLVED] mysql post from php


chriscloyd

Recommended Posts

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";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/178412-solved-mysql-post-from-php/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.