Jump to content

Recommended Posts

Hi guys, i have a php form that pulls 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 on the database so that i can have both numbers and letters as data.

 

do spaces in the data have anything to do with it?

or should this be more of a question for a mySql forum?

**also the text field on my php form is a large enough size to hold the data - so i doubt that is the issue anyway - it pulls in all the data even if it was not long enough wouldnt it?

please advise - thanks!

Link to comment
https://forums.phpfreaks.com/topic/139441-truncation-of-data/
Share on other sites

It is probably how you are outputting the data to the browser. The most likely cause is invalid HTML due to no quotes around the value parameter in the form field. Code please?

 

the following is in the PHP file:

 

while ($row = mysql_fetch_array($result))

  {

  extract($row);

echo "<div width='98%'>

<table width='420px' style='float:left' class='topprofiletable'>

<tr><td><b><font color='666666'>Family Member:</font></b> </td><td>$clientNumber </td></tr>

<tr><td><b><font color='0000ff'>$firstName, $Minitial $lastName</font></b></td><td> <b>Gender:</b>$gender</td></tr>

<tr><td style='float:left' class='item'>Street Address:</td><td style='float:right'><input type='text' name='streetad' value=$streetAddress></td></tr>

<tr><td style='float:left' class='item'>City:</td><td style='float:right'><input type='text' name='city' value=$city></td></tr>

<tr><td style='float:left' class='item'>Province:</td><td style='float:right'><input type='text' name='prov' value=$province></td></tr>

<tr><td style='float:left' class='item'>Postal Code:</td><td style='float:right'><input type='text' name='postal' value=$postal></td></tr>

<tr><td style='float:left' class='item'>Phone Number:</td><td style='float:right'><input type='text' name='phone' value=$Hphone></td></tr>

<tr><td style='float:left' class='item'>Cell Number:</td><td style='float:right'><input type='text' name='cell' value=$Cphone></td></tr>

<tr><td style='float:left' class='item'>Office Number:</td><td style='float:right'><input type='text' name='work' value=$Wphone></td></tr>

<tr><td style='float:left' class='item'>Fax:</td><td style='float:right'><input type='text' name='fax' value=$Fax></td></tr>

<tr><td style='float:left' class='item'>Email:</td><td style='float:right'><input type='text' name='email' value=$email></td></tr>

</table>

</div>";

}

Link to comment
https://forums.phpfreaks.com/topic/139441-truncation-of-data/#findComment-730262
Share on other sites

 

 

How about fixing your code for what was already posted as the most likely problem -

The most likely cause is invalid HTML due to no quotes around the value parameter in the form field.

 

Also, any values echoed into form fields that could contain HTML entities (<, ', ", >...) should be passed through htmlentities so that those HTML entities don't break your web page.

Link to comment
https://forums.phpfreaks.com/topic/139441-truncation-of-data/#findComment-730280
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.