beaux1 Posted February 17, 2007 Share Posted February 17, 2007 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 More sharing options...
papaface Posted February 17, 2007 Share Posted February 17, 2007 change it to: echo '<input name="number" type="text" class="text" value="'.$row["number"].'" size="15"/>'; Link to comment https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-186782 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 \" Link to comment https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-186783 Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 echo "<input name=\"number\" type=\"text\" class=\"text\" value=\"$row['number']\" size=\"15\"/>"; Link to comment https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-186786 Share on other sites More sharing options...
The_Assistant Posted February 17, 2007 Share Posted February 17, 2007 echo '<input name="number" type="text" class="text" value="{$row['number']}" size="15"/>'; Link to comment https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-186842 Share on other sites More sharing options...
spfoonnewb Posted February 17, 2007 Share Posted February 17, 2007 *Edit* Missed papa's post :X Link to comment https://forums.phpfreaks.com/topic/38846-simple-question/#findComment-186861 Share on other sites More sharing options...
BreakBreak Posted February 17, 2007 Share Posted February 17, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.