473,471 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Form values are truncated

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

Jul 19 '05 #1
0 1223

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: vishal | last post by:
hi i am using get method to pass data from one form to another and my value may contain & symbol. so when this is case the value after & sign is truncated which is logically true. so what...
0
by: James Johnson | last post by:
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...
2
by: | last post by:
Hi everyone, I'm using VS.NET, Framework 1.1, Windows 2000 Server, IIS 5, all the latest patches are installed. Im having this wierd random problem, that I cannot reproduce but it happens...
0
by: bunty.gopal | last post by:
I am trying to use the PreparedStatement's addBatch to load data in an ETL-like process into a table. There is a single prepared statement. The parameters are set on it and prepStmt.addBatch() is...
4
by: Jack | last post by:
THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS reccount FROM Equipmenttbl " sql01 = sql01 & "WHERE Equipmenttbl.GrantID = " & GrantID 'Response.Write sql01 &...
12
by: Jack | last post by:
Since, I have not got some desired advise, I am reposting this for some asnwer/valuable suggestion. Thanks. THE FOLLOWING IS A PART OF CODE FROM A ASP PAGE <% sql01 = "SELECT COUNT(*) AS...
8
by: david.lindsay.green | last post by:
Hello all, I am quite new a web scripting and making web pages in general and I have stumbled across a problem I have as yet been unable to solve. I am trying to take the contents of a textarea box...
1
by: bunty.gopal | last post by:
This is the solution to the issue in the subject, question itself was posted in a previous thread long back. Use the latest DB2 db2cc.jar fixpack on the client, or add "deferPrepares=false" to...
2
by: The Cool Giraffe | last post by:
I've designed a method in the class called Blopp. class Blopp { void foo (int a = 3, double b = 3.6) {} } ; The problem is only that when i call the method, the value of b seems to be...
19
by: Hrvoje Voda | last post by:
I'm using 2 integer numbers X and Y. I would like to replace there values(Y=X, X=Y) but without using any other variables or functions. Hrcko
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.