Have You solved? Do You use GET or POST method? What happens without trim? Do You test errors after the insert? if( mysql_errno() != 0) echo mysql_errno() . ": " . mysql_error() . "<BR>";
What happens if Yoy type (cut & paste) the query in a terminal with mysql?
I used it many times and it works fine!
Santino
At 8:49 -0700 11-08-2003, James Johnson wrote:
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('[EMAIL PROTECTED]','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/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]