36 users online (2 members and 34 guests)  


  Results 1 to 7 of 7

Related

  1. Replies: 0
  2. Replies: 11
  3. Need Help : mysql advanced SELECT issue    Forum: Databases
    Replies: 6
  4. Replies: 1
  5. Replies: 4
  1. #1
    lbbeeson's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Location
    Tulsa, OK
    Posts
    4

    Issue with Form Value only displaying initial # of a retrieved mysql text field.

    I am writing a directory form that will display the users contact information then allow them to update if desired. all is working great except for my address field. The contents are "9999 S. mystreet st". In th form it is only displaying 9999. I assume it is believing this is a number field. The address field in the DB is a varchar(30). Here is an extract of the code:

    $row = mysqli_fetch_assoc($result);

    extract($row);

    echo "<form name='EditOwner' method='post' action='UpdateOwner.php'>";

    echo "Address: <input name='Address' type='text'
    id='Address' size='30' value=", $Address, "></td></tr>";

    I can echo the entire contents of the field seperately.

    Help!

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    Replace your commas with periods:

    Code:
    echo "Address: <input name='Address' type='text'
    id='Address' size='30' value=". $Address . "></td></tr>";
    Also, you might want to look at the rendered code. Sometimes that can be a clue as to what you're doing wrong.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  3. #3
    lbbeeson's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Location
    Tulsa, OK
    Posts
    4

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    Thanks but that didn't work.

  4. #4
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    What does the rendered code look like?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  5. #5
    lbbeeson's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Location
    Tulsa, OK
    Posts
    4

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    <td><b>Address: </b></td><td><input name= 'Address' type='text'
    id='Address' size='30' value=6023 E. 53rd St.> </td></tr>

    so it has the address in the rendered code but only displays "6023". What's up with that?

  6. #6
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    Quote Originally Posted by lbbeeson View Post
    <td><b>Address: </b></td><td><input name= 'Address' type='text'
    id='Address' size='30' value=6023 E. 53rd St.> </td></tr>

    so it has the address in the rendered code but only displays "6023". What's up with that?
    Because there are no quotes around the value. That's why I wanted you to look at the rendered code too.

    Now that I can see the problem, try this code instead:

    Code:
    echo "Address: <input name='Address' type='text'
    id='Address' size='30' value='". $Address . "'></td></tr>";
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  7. #7
    lbbeeson's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2008
    Location
    Tulsa, OK
    Posts
    4

    Re: Issue with Form Value only displaying initial # of a retrieved mysql text field.

    Thanks that fixed it. appreciate the help.