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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.