Truncation of data...?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
cyandi_man
Forum Newbie
Posts: 12
Joined: Sun Nov 02, 2008 10:47 am

Truncation of data...?

Post by cyandi_man »

Hi guys, i have a php form that pull data from mySql database.
for some reason this info is being truncated.

ex. in the zipcode field only first 3 numbers show up
and only the first part of the street address shows up.

I do have that particular cell as VARCHAR so that i can have both numbers and letters as data

do spaces in the data have anything to do with it?
please advise - thanks!

** also my field size on the php form is more than enough to contain this data...so i doubt that is the issue here.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Truncation of data...?

Post by John Cartwright »

Sounds to me like you are not quoting your value fields (assuming this is a form).

Code: Select all

<input ....     value=<?php echo $row['your_field_name']; ?> />
versus

Code: Select all

<input ....     value="<?php echo $row['your_field_name']; ?>" />
Otherwise, check your database schema to make sure you set the varchar's length long enough.
Post Reply