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? Quote Link to comment 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"/>'; Quote Link to comment Share on other sites More sharing options...
sspoke Posted February 17, 2007 Share Posted February 17, 2007 \" Quote Link to comment 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\"/>"; Quote Link to comment 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"/>'; Quote Link to comment Share on other sites More sharing options...
spfoonnewb Posted February 17, 2007 Share Posted February 17, 2007 *Edit* Missed papa's post :X Quote Link to comment 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"/> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.