Jump to content

[SOLVED] MYSQL PHP code works with older version.


$username

Recommended Posts

Hello guys and girls,

    I am having issue with they way that my PHP MYSQL code works with the MYSQL version 5.0.45

 

Here is the Code that inserts the data into the database. The thing is the tables that have a int in MYSQl error when there is no value present.

 

<?php
} else {
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$AddressStreet = $_POST['AddressStreet'];
$AddressCity = $_POST['AddressCity'];
$AddressState = $_POST['AddressState'];
$AddressZip = $_POST['AddressZip'];
$CaseNotes1 = $_POST['CaseNotes1'];
$CaseNotes2 = $_POST['CaseNotes2'];
$CaseNotes3 = $_POST['CaseNotes3'];
$CaseNotes4 = $_POST['CaseNotes4'];
$OtherInfo = $_POST['OtherInfo'];
$ServBy = $_POST['ServBy'];
$Paid = $_POST['Paid'];
$Amount = $_POST['Amount'];
$ClientName = $_POST['ClientName'];
$ServDate = $_POST['ServDate'];
$County = $_POST['County'];
$query33 = ("INSERT INTO `store` (FirstName, LastName, AddressStreet, AddressCity, AddressState, AddressZip, CaseNotes1, CaseNotes2, CaseNotes3, CaseNotes4, OtherInfo, ServBy, Paid, Amount, ClientName, County, ServDate) VALUES ('$FirstName', '$LastName', '$AddressStreet', '$AddressCity', '$AddressState', '$AddressZip', '$CaseNotes1', '$CaseNotes2', '$CaseNotes3', '$CaseNotes4', '$OtherInfo', '$ServBy', '$Paid', '$Amount', '$ClientName', '$County', '$ServDate')");

$insert_res = @mysql_query($query33) or die(mysql_error());
echo "Your Info Has Been Added ";

}
mysql_close($conn);
?>

 

 

Database structure

Field  Type  Collation  Attributes  Null  Default

 

  AddressZip  smallint(10)    No 

 

 

What would make this happen. should I add that if there is no value present to make it 0?

 

Thank you,

Brett

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.