All,
I'm building a member signup form. Fields that contain more than one word
are being truncated when being inserted into the MySQL table.
I'm using this code that I got from one of my PHP books.
$as_addr1 = addslashes($_POST['addr1']);$tr_addr1 = trim($as_addr1);
So, if I post "1122 Boogie St." it gets inserted as "1122". If I remove the
"addslashes" portion, only using trim, I get the same result.
Here's the query:
$query = "INSERT INTO subscribers
(email,password,fName,lName,addr1)
VALUES
('$tr_email','$tr_pass','$tr_fName','$tr_lName','$ tr_addr1'";
echo $query;
Here's the echo:
INSERT INTO subscribers (email,password,fName,lName,addr1)
VALUES('j@j.com','11111111','Jim','Johnson','78797 State')
I have other fields in the table that are doing the same thing. All fields
are varchars of varying length. Field "addr1" is varchar(50).
Suggestions?
Thanks,
James
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw