SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot LiamW's Avatar
    Join Date
    Mar 2003
    Location
    Hamilton, Ontario
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Displaying row result(mysql) in an input box problem

    I'm having problems displaying the whole string in an input box, it only shows the first word.

    Here is a little more info

    I do the below code

    PHP Code:
    $row mysql_fetch_array($result);
    $name $row['name']; 
    <input name='name' type='text' value=<?=$name?>>

    The code gets the correct results but only displays the first word in $name no matter how many words the string is.

    The same code will display the whole string if used in a <textbox> but only the first word if used in a <input> box.

    Any thoughts/experience?

  2. #2
    SitePoint Guru dragonhawk's Avatar
    Join Date
    Apr 2002
    Location
    Melbourne
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change from this:
    <input name='name' type='text' value=<?=$name?>>

    To this:

    <input name='name' type='text' value="<?=$name?>">

  3. #3
    SitePoint Zealot LiamW's Avatar
    Join Date
    Mar 2003
    Location
    Hamilton, Ontario
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol
    Thanks a bunch. Can't believe I couldn't see I was missing those.

    I hate when that happens.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •