Current location: Hot Scripts Forums » Programming Languages » PHP » Data being shortened


Data being shortened

Reply
  #1 (permalink)  
Old 09-21-09, 01:33 PM
cyberfolli cyberfolli is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 93
Thanks: 8
Thanked 0 Times in 0 Posts
Data being shortened

Hi I am trying to input data into hidden fields to be passed to another table but the information seems to be being shortened to only one word in a sentence.. it displays correctly if I just display it but if I add the info as a value in a field or in a hidden field it gets shortened to one word.. I have never run into this problem..

Code:
ini_set ("display_errors", "1");
error_reporting(E_ALL);  

$id = $_GET['id'];
$query = "SELECT * FROM table WHERE id = '$id'";
$result = mysql_query($query);

while($row = mysql_fetch_array($result)) {

echo "<input name=".$row['title']." type=text value=".$row['title']." size=20 /><br>";
echo "".$row['stamp']."<br>";
echo "".$row['reoccurr']."<br>";
echo "".$row['department']."<br>";
echo "".$row['notes']."<br>";
I am not sure why but the regular non field data displays fine


any ideas would be helpful
Reply With Quote
  #2 (permalink)  
Old 09-21-09, 01:59 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Add some double quotes, note the use of single quotes to encapsulate it all.

PHP Code:

echo '<input name="'.$row['title'].'" type="text" value="'.$row['title'].'" size="20" /><br />'
Reply With Quote
The Following User Says Thank You to wirehopper For This Useful Post:
cyberfolli (09-21-09)
  #3 (permalink)  
Old 09-21-09, 02:19 PM
cyberfolli cyberfolli is offline
Newbie Coder
 
Join Date: Jan 2004
Posts: 93
Thanks: 8
Thanked 0 Times in 0 Posts
wow I have been laboring over that for a while.. thank you very grateful!
Reply With Quote
Reply

Bookmarks

Tags
data being shortened


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.