Jump to content

Simple Question


beaux1

Recommended Posts

I am working on an edit script for my project, this is a rather simple question.

 

My aim is to put the data from the column in as the default value of the textbox, so the previous data already in the database will be in the textbox, using $row['number'].

However, I get this error: Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\edit.php on line 39

 

echo '<input name="number" type="text" class="text" value="$row['number']" size="15"/>';

 

 

Just wondering what I need to add/change to get that working?

 

Link to comment
Share on other sites

echo '<input name="number" type="text" class="text" value="$row['number']" size="15"/>';

 

I don't really like using echo at the beggining of these things, you'll have problems with the /'s and generally it gets messy.

 

I had to do this A LOT for my latest project and i did this instead:

 

 

 

<input name="number" type="text" class="text" value="<? echo "$row['number']"; ?>" size="15"/>

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.