captain_scarlet87 Posted March 2, 2010 Share Posted March 2, 2010 Hey all, having a little trouble displaying usernames from a database and then having a link alongside each displayed username to edit it. I'm using this script: <?php # Script 13.8 - edit.php // Include the configuration file for error management and such. require_once ('./includes/config.inc.php'); // Set the page title and include the HTML header. $page_title = 'Users'; include ('./includes/header.html'); ?> <table> <tr> <td align="center">Edit Users</td> </tr> <tr> <td> <table border="1"> <? require_once ('../mysql_connect.php'); // Connect to the database. $order = "SELECT username FROM users"; $result = mysql_query($order); while ($row=mysql_fetch_array($result)){ echo ("<tr><td>$row[username]</td>"); echo ("<td><a href=\"edit_form.php?id=$row[username]\">Edit</a></td></tr>"); } ?> </table> </td> </tr> </table> <?php include ('./includes/footer.html'); ?> The page displays this: Edit Users "); echo (""); } ?> $row[username] Edit - this line being inside the table. Please help if you can. Thanks. Link to comment https://forums.phpfreaks.com/topic/193888-edit-data/ Share on other sites More sharing options...
aeroswat Posted March 2, 2010 Share Posted March 2, 2010 Well to start you are missing the acro php in this code <td> <table border="1"> <? Should be <td> <table border="1"> <?php Also why are you putting parentheses around your echo strings? Take those off Link to comment https://forums.phpfreaks.com/topic/193888-edit-data/#findComment-1020407 Share on other sites More sharing options...
captain_scarlet87 Posted March 3, 2010 Author Share Posted March 3, 2010 Thanks aeroswat, I added in the acro php and it now it displays correctly. Link to comment https://forums.phpfreaks.com/topic/193888-edit-data/#findComment-1021012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.