Jump to content

more than one word issue


mtgriffiths

Recommended Posts

Hi All,

 

I am trying to display the information from a query into a text box so that i can create an update function.

 

The code i am using is:

 

$Query = mysql_query("SELECT * FROM team_details WHERE Team_Name = '$Team'")
or die(mysql_error()); 

while($row = mysql_fetch_assoc($Query)){

<input type='text' name='Team_ID' value=<?php echo $row['Captain']; ?>>

 

The problem i am getting is that the value will display Matthew but inside the database the value that should be pulled is Matthew Griffiths.

 

The second word is being cut off

 

Is there any way of stopping this?

 

Thanks in advance

 

Matthew

Link to comment
Share on other sites

while($row = mysql_fetch_assoc($Query)){

<input type='text' name='Team_ID' value=<?php echo $row['Captain']; ?>>

if the 'value=' clause has a value that has a space in it, it has to be surrounded by quotes.  As well if the loop executes more than once, you will have multiple form fields with the same name, 'TEAM_ID' and you should not do that.

<input type='text' name='Team_ID' value="<?php echo $row['Captain']; ?>">

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.