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
https://forums.phpfreaks.com/topic/38846-simple-question/
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
https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-187020
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.