richard_PHP Posted March 28, 2009 Share Posted March 28, 2009 hello all, cant quite get this to work. ive narrowed it down to getting no errors ( ) but now it is just not displaying anything. i want there to be an input form with text boxes, each showing address lines (which have been stored in a database). heres the code: <?php Connect(); $sql = "SELECT `firstName`, `address1`, `address2`, `address3`, `city`, `postcode` FROM `Customers` WHERE `firstName` LIKE '".$_SESSION['name']."'"; $result = mysql_query($sql, $connection); $Row = mysql_fetch_array($result); while($Row) { echo '<tr><td>Address 1</td><td><input type="text" size="3" name="address1" value="<?php echo $array[address1]; ?>" /></td></tr>'; echo '<tr><td>Address 2</td><td><input type="text" size="30" name="address2" value="<?php echo $array[address2]; ?>" /></td></tr>'; echo '<tr><td>Address 3</td><td><input type="text" size="30" name="address3" value="<?php echo $array[address3]; ?>"/></td></tr>'; echo '<tr><td>City</td><td><input type="text" size="30" name="city" value="<?php echo $array[city]; ?>" /></td></tr>'; echo '<tr><td>Postcode</td><td><input type="text" size="15" name="postcode" value="<?php echo $array[postcode]; ?>" /></td></tr>'; echo '</table>'; } ?> Link to comment https://forums.phpfreaks.com/topic/151556-solved-displaying-text-in-textboxes/ Share on other sites More sharing options...
richard_PHP Posted March 28, 2009 Author Share Posted March 28, 2009 note, the address 1 line (first echo) doesnt show an asterik.. there is one! and ive used an include which works Link to comment https://forums.phpfreaks.com/topic/151556-solved-displaying-text-in-textboxes/#findComment-795981 Share on other sites More sharing options...
richard_PHP Posted March 28, 2009 Author Share Posted March 28, 2009 changed ARRAY to ROW as it is declared but it still doesnt work.. code: <?php $sql = "SELECT `firstName`, `address1`, `address2`, `address3`, `city`, `postcode` FROM `Customers` WHERE `firstName` LIKE '".$_SESSION['name']."'"; $result = mysql_query($sql, $connection); $Row = mysql_fetch_array($result); while($Row) { echo '<tr><td>Address 1</td><td><input type="text" size="3" name="address1" value="<?php echo $Row[address1]; ?>" /></td></tr>'; echo '<tr><td>Address 2</td><td><input type="text" size="30" name="address2" value="<?php echo $Row[address2]; ?>" /></td></tr>'; echo '<tr><td>Address 3</td><td><input type="text" size="30" name="address3" value="<?php echo $Row[address3]; ?>"/></td></tr>'; echo '<tr><td>City</td><td><input type="text" size="30" name="city" value="<?php echo $Row[city]; ?>" /></td></tr>'; echo '<tr><td>Postcode</td><td><input type="text" size="15" name="postcode" value="<?php echo $Row[postcode]; ?>" /></td></tr>'; echo '</table>'; } ?> Link to comment https://forums.phpfreaks.com/topic/151556-solved-displaying-text-in-textboxes/#findComment-795995 Share on other sites More sharing options...
richard_PHP Posted March 28, 2009 Author Share Posted March 28, 2009 anyone care to help me with this one? i need this done by monday. pleeaaassse!!! Link to comment https://forums.phpfreaks.com/topic/151556-solved-displaying-text-in-textboxes/#findComment-796014 Share on other sites More sharing options...
richard_PHP Posted March 28, 2009 Author Share Posted March 28, 2009 got it working. had to change a session elsewhere Link to comment https://forums.phpfreaks.com/topic/151556-solved-displaying-text-in-textboxes/#findComment-796018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.