RE: [PHP-DB] Data not fetching in the textfield.

From: Date: Wed, 26 Sep 2007 16:37:21 +0000
Subject: RE: [PHP-DB] Data not fetching in the textfield.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44062@lists.php.net to get a copy of this message
Try replacing this: echo ' <input name="storename" type="text" maxlength="35" id="storename" class="regForm" disabled="disabled" value=$rows[0]></input>' ; With this: echo ' <input name="storename" type="text" maxlength="35" id="storename" class="regForm" disabled="disabled" value='. $rows[0].'></input>' ; -----Original Message----- From: Chris Carter [mailto:chandan9sharma@yahoo.com] Sent: Wednesday, September 26, 2007 10:04 PM To: php-db@lists.php.net Subject: [PHP-DB] Data not fetching in the textfield. I am trying to fetch data through this code: My code: for($i=0;$i<mysql_num_rows($results);$i++) { $rows = mysql_fetch_array($results); echo '<div>' ; echo ' <div class="fieldrow">' ; echo ' ' ; echo ' <label for="storename">Store name:</label>' ; echo ' ' ; echo ' <input name="storename" type="text" maxlength="35" id="storename" class="regForm" disabled="disabled" value=$rows[0]></input>' ; echo ' </div>' ; The value option in the textfield is not fetching the data, neither is it throwing errors. However the same code works perfectly as suggested by one of expert Nabble users: Nabble code: for($i=0;$i<mysql_num_rows($results);$i++) { $rows = mysql_fetch_array($results); echo("<input name=\"input1\" type=\"text\" value=$rows[0]>"); } Please help. Chris -- View this message in context: http://www.nabble.com/Data-not-fetching-in-the-textfield.-tf4523451.html#a1 2904665 Sent from the Php - Database mailing list archive at Nabble.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#44062) next »