Jump to content

info doesnt get added to my db


primcrew

Recommended Posts

im just trying a simple test to add info to my db

 

--Db info

 

$HOST="----";
$USER="----";
$PASSWORD="----";
$DB="----";

$db_connect=" mysql_connect($HOST, $USER, $PASSWORD)";
$select_db="mysql_select_db($DB, $db_connect)";
if ($db_connect){print("Connected<br>");}
else {print("error");}
if ($select_db){print("Db-Connected<br>");}
else {print("error");}
---
php page info---

if ($_GET['new_customer_submit']){print("Form Submitted<br>");
								$result="INSERT INTO 'test' ('cust_id','last_name')																

VALUES
(' ' , '$_GET[new_customer_lastname]'																	
																)";
								$result_ex = mysql_query($result);
								if ($result_ex){print("New Customer Added<br>");}
								else {print("Add Customer Error!<br>");}

							  }
else {print("New Form");}

it says it connects fine and i see the results in the get link but it wont add to db

 

Link to comment
Share on other sites

I added


tags around your code, please use them next time.

 

Your code is hard to read due to lack of formatting.  Try temporarily changing this line to:

$result_ex = mysql_query($result) or die(mysql_error());

 

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.