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

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.