> All,
>
Howdy,
> 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);
I think trim is trimming off the stuff after the first whitespace?
What is the trim function supposed to do?
Mysql isn't doing it your PHP is.
Use Perl and I bet it starts working :) ok, or you could fix or
replace the trim function with one that does not remove that data.
HTH
DMuey
>
> 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]