jamesxg1 Posted March 27, 2009 Share Posted March 27, 2009 <table border="1" width="820" cellpadding="5" bgcolor="#ffffff" bordercolor="#808080" style="border-collapse: collapse;" id="BannedUsersTable"> <tr> <td align="center" width="" bgcolor="#c0c0c0"> Username: </td> <td align="center" width="" bgcolor="#c0c0c0"> I.P Address: </td> </tr> <tr> <?php $query = mysql_query("SELECT * FROM banip") or die(mysql_error()); while ($row = mysql_fetch_object($query)) { echo '<td align="center" width="" bgcolor="#c0c0c0"> <a href="admin.php?form=adduser&order=id">$row->username</a> </td> <td align="center" width="" bgcolor="#c0c0c0"> <a href="admin.php?form=adduser&order=firstname">$row->IP</a> </td>'; } ?> </tr> it isnt displaying the information its displaying $row->username $row->IP and i need to display the info anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/151462-solved-help-with-mysql-rows/ Share on other sites More sharing options...
Maq Posted March 27, 2009 Share Posted March 27, 2009 In your echo switch the single quotes and double quotes around. Variables don't interpolate in a single quotes string. Quote Link to comment https://forums.phpfreaks.com/topic/151462-solved-help-with-mysql-rows/#findComment-795558 Share on other sites More sharing options...
ratcateme Posted March 27, 2009 Share Posted March 27, 2009 you need to exit single quotes to include a php var like this echo '<td align="center" width="" bgcolor="#c0c0c0"> <a href="admin.php?form=adduser&order=id">'.$row->username.'</a> </td> <td align="center" width="" bgcolor="#c0c0c0"> <a href="admin.php?form=adduser&order=firstname">'.$row->IP.'</a> </td>'; Scott. Quote Link to comment https://forums.phpfreaks.com/topic/151462-solved-help-with-mysql-rows/#findComment-795560 Share on other sites More sharing options...
Maq Posted March 27, 2009 Share Posted March 27, 2009 ^--- or that, which is a lot easier Quote Link to comment https://forums.phpfreaks.com/topic/151462-solved-help-with-mysql-rows/#findComment-795561 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.