Hi, I've search th
I have I think two problems with my INSERT. I've searched through the forums and did some googling without much luck.
I have a form that sends/posts the collected entries to a processing form which performs some checks to see if data entry meets all requirements, and redisplays the data they entered by re-invoking the $fields. The user can look it over to see if everything is correct before submitting the data to be inserted into the database. Note: When I echo back the results from the form, all fields are correct and are not cut off (explained below).
But the problem is, if the user enters in data like this:
PictName: 'endang seaturtle.jpg' (just a string, no images stored in DB)
Comments: 'Buoy is in for repairs'
The data that is saved in MySQL database for Location is just "endang" and for the Comments, "" (empty/blank). Most of the fields are just one word length and insert perfectly fine.
Location VARCHAR(20) NULL DEFAULT NULL
Comments VARCHAR(200) NULL DEFAULT NULL
My Insert looks like this:
$query = "INSERT INTO tblNetDesc (SubSample, InitialDate, NetClassID, PictName, Comment) VALUES ('$subsample', '$the_date2', '$netclassid', '$picturename', '$comment')";
$result = mysql_query($query) or die ($query.mysql_error());
Also if it helps, PictName is an input field and Comment is a textarea field on the form.
How come it won't save the white space? Why isn't the comment field saving?
Any help greatly appreciated.
Thanks for looking,
-T
I have I think two problems with my INSERT. I've searched through the forums and did some googling without much luck.
I have a form that sends/posts the collected entries to a processing form which performs some checks to see if data entry meets all requirements, and redisplays the data they entered by re-invoking the $fields. The user can look it over to see if everything is correct before submitting the data to be inserted into the database. Note: When I echo back the results from the form, all fields are correct and are not cut off (explained below).
But the problem is, if the user enters in data like this:
PictName: 'endang seaturtle.jpg' (just a string, no images stored in DB)
Comments: 'Buoy is in for repairs'
The data that is saved in MySQL database for Location is just "endang" and for the Comments, "" (empty/blank). Most of the fields are just one word length and insert perfectly fine.
Location VARCHAR(20) NULL DEFAULT NULL
Comments VARCHAR(200) NULL DEFAULT NULL
My Insert looks like this:
$query = "INSERT INTO tblNetDesc (SubSample, InitialDate, NetClassID, PictName, Comment) VALUES ('$subsample', '$the_date2', '$netclassid', '$picturename', '$comment')";
$result = mysql_query($query) or die ($query.mysql_error());
Also if it helps, PictName is an input field and Comment is a textarea field on the form.
How come it won't save the white space? Why isn't the comment field saving?
Any help greatly appreciated.
Thanks for looking,
-T