Jump to content

Stings Getting Truncated


websteve

Recommended Posts

I have some data that when I type in a string in a text box, (e.g. John Smith), the data is trunctated when it is inserted into the database (only 'John; would show up).  I noticed that it seems to cut the data off after a white space. If I combine the words, then they are inserted properly.

 

Does this sound like something simple I'm missing or is it something more complex?

 

The text size is 20 and the db field is Varchar 30.

 

Any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

It does write to the database, so the problem seems to be when the program reads it back from the db.  Here is the code:

 

 

while ($ResultsArr_pur = mysql_fetch_array($Results_pur)) {

$item='item'.$i;

$description='description'.$i;

$quantity='quantity'.$i;

$price='price'.$i;

$date='date'.$i;

$ampm='ampm'.$i;;

$comments='comments'.$i;

$status='status'.$i;

 

      echo "<tr><td><input type=text size=5 name=".$item ." value=".$ResultsArr_pur['Item']."></td><td><input type=text size=35 name=".$description ." value=".$ResultsArr_pur['Description']."></td><td><input type=text size=5 name=".$quantity ." value=".$ResultsArr_pur['Quantity']."></td><td><input type=text size=10 name=".$price ." value=".$ResultsArr_pur['Price']."></td><td>$".$ResultsArr_pur['Price'] * $ResultsArr_pur['Quantity']."</td><td><input type=text name=".$date ." value=". $ResultsArr_pur['Date'] . "></td><td><select name=".$ampm ."><option>" . $ResultsArr_pur['AMPM'] . "</option><option>AM</option><option>PM</option></select></td><td><input type=text name=".$comments ."size=35 value=". $ResultsArr_pur['Comments'] ."></td><td><select name=".$status . "><option>Undelivered</option><option>Delivered</option>".$ResultsArr_pur['Status']."</option></select></td></tr>";

$i=$i+1;  $n=$n+1;

}

 

Link to comment
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.