Simple form error updating database

I am receiving the error “‘Error updating database’”, after adding all the fields after the Email field. So the dropdown menu and radio buttons are the issue, I beleive?
Any help would be greatly appreciated… THANK YOU.

PHP:


<?php

$Name = $_POST['Name'];
$Company = $_POST['Company'];
$Phone = $_POST['Phone'];
$Email = $_POST['Email'];
$Occupation = $_POST['Occupation'];
$Other_Occupation = $_POST['Other_Occupation'];
$Print = $_POST['Print'];
$Fulfillment_Projects = $_POST['Fulfillment_Projects'];
$Fulfillment_Programs = $_POST['Fulfillment_Programs'];
$Direct_Mail = $_POST['Direct_Mail'];
$Other = $_POST['Other'];
$Other_Intrest = $_POST['Print'];


mysql_connect ("localhost", "#######", "#######") or die ('Error: ' . mysql_error());
mysql_select_db ("qr_codes");

$query="INSERT INTO  job24520 (Response_ID, Name, Company, Phone, Email, Occupation, Other_Occupation, Print, Fulfillment_Projects, Fulfillment_Programs, Direct_Mail, Other, Other_Intrest)VALUES ('NULL', '".$Name."', '".$Company."', '".$Phone."', '".$Email."' '".$Occupation."' '".$Other_Occupation."' '".$Print."' '".$Fulfillment_Projects."' '".$Fulfillment_Programs."' '".$Direct_Mail."' '".$Other."' '".$Other_Intrest."')";

mysql_query($query) or die ('Error updating database');

echo "Database has been Updated"; 
?>

HTML


<form method="post" action="update.php">

<span style="color: red;">* </span>
<strong>Full Name:</strong> <br />
<input type="text" name="Name" size="30" /> <br /><br />

<span style="color: red;">* </span>
<strong>Company:</strong> <br />
<input type="text" name="Company" size="30" /> <br /><br />

<span style="color: red;">* </span>
<strong>Phone:</strong> <br />
<input type="text" name="Phone" size="15" /> <br /><br />

<span style="color: red;">* </span>
<strong>E-mail:</strong> <br />
<input type="text" name="Email" size="30" /> <br /><br />

<strong>I would like to talk further about Doing Business Together!</strong> <br /><br />

<strong>I am a...</strong> <br />

<select name="Occupation">
<option value="Graphic Designer">Graphic Designer</option>
<option Value="Marketing Consultant">Marketing Consultant</option>
<option Value="Design Company">Design Company</option>
<option Value="Agency">Agency</option>
<option Value="Print Deistributor">Print Distributor</option>
<option Value="Other">Other</option>
</select>
<br /><br />

If you selected other, please specify:<br />
<input type="text" name="Other_Occupation" size="30"/> 
<br /><br />

<strong>I would be interested in?</strong><br />
<input type="radio" name="Print" Value="Y" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" /> 

Print On Demand Web Portal<br />
<input type="radio" name="Fulfillment_Projects" Value="Y" 
onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" /> 

Fulfillment Projects (kitting/assembly)<br />
<input type="radio" name="Fulfillment_Programs" Value="Y" 
onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" /> 

Fulfillment Programs (Pick/Pack/ship)<br />
<input type="radio" name="Direct_Mail" Value="Y" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" /> 

Direct Mail Production<br />
<input type="radio" name="Other" Value="Y" onmousedown="this.__chk = this.checked" onclick="if (this.__chk) this.checked = false" /> 

Other: <input type="text" name="Other_Intrest" size="30"/> <br /><br />

<input type="submit" value="Register" />

</form>

Are your database fields large enough to hold the data? Also there is a typo in the HTML form,

<option Value=“Print Deistributor”>

Yes they all should be long enough to hold the data.
Also i will change that spelling but shouldnt effect the failure.

Change this

mysql_query($query) or die ('Error updating database');

into something more meaningful:

mysql_query($query) or die ('Error updating database ' . mysql_error() . " in query $query");

Thank you… Form

New Error!

Error updating database Column count doesn’t match value count at row 1 in query INSERT INTO job24520 (Response_ID, Name, Company, Phone, Email, Occupation, Other_Occupation, Print, Fulfillment_Projects, Fulfillment_Programs, Direct_Mail, Other, Other_Intrest)VALUES (‘NULL’, ‘Ryan Eldridge’, ‘FPMSI’, ‘9786202800’, ‘reldridge@fpmsi.com’ ‘Design Company’ ‘Design Firm’ ‘Y’ ‘Y’ ‘Y’ ‘Y’ ‘Y’ ‘Y’)

Take a good look at that query. Do you see what’s wrong? Some little thingies are missing.

SQL Database IMG w/ Field Lengths.

‘reldridge@fpmsi.com’ ‘Design Company’ ‘Design Firm’ ‘Y’ ‘Y’ ‘Y’ ‘Y’ ‘Y’ ‘Y’
The error lies in this part of the query: the comma’s are missing :slight_smile:

WOW. I can not believe i did not see that… Its always the smallest detail.
Thank you so much

If you dont mind I have another question. After the form is submitted the
echo “Database has been Updated”; Is shown.

How do i use HTML here to customize the page look / feel?

Sorry new to PHP

Just like you’d do in any other page.
Maybe I didn’t understand the question?

Sorry this is my first time using PHP. The update.php script that runs after the form is submitted is just php code. Do I place HTML within the php? or…

This is where a template might come in handy.
Otherwise you’ll have to make sure the update.php script shows a complete html page, or redirect to another page that’ll show the “database has been updated” message.