waynewex Posted April 29, 2008 Share Posted April 29, 2008 Okay, when I use this page, all I get is... nothing. Not even the Title of the page will show. What do you think? <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Users</title> </head> <body><?php $user="*******"; $password="********"; $database="*********"; $conn = mysql_connect("*************" ,$user,$password); @mysql_select_db($database, $conn) or die(mysql_error); $result = mysql_query("SELECT * FROM USERS"); echo = "<TABLE>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['NAME'] . "</td>"; echo "<td>" . $row['USERNAME'] . "</td>"; echo "<td>" . $row['EMAIL'] . "</td>"; echo "</tr>"; } echo "</TABLE>"; mysql_close($conn); ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
psychowolvesbane Posted April 29, 2008 Share Posted April 29, 2008 Try: $result = mysql_query("SELECT * FROM USERS",$conn); Quote Link to comment Share on other sites More sharing options...
waynewex Posted April 29, 2008 Author Share Posted April 29, 2008 No still no luck. I must note that the table contains extra columns such as password etc, but even with the "SELECT NAME, USERNAME (etc) FROM USERS," I still get jack. Quote Link to comment Share on other sites More sharing options...
waynewex Posted April 29, 2008 Author Share Posted April 29, 2008 Here's the current code: $result = mysql_query("SELECT ID, EMAIL, NAME, USERNAME FROM USERS"); echo = "<TABLE>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['NAME'] . "</td>"; echo "<td>" . $row['USERNAME'] . "</td>"; echo "<td>" . $row['EMAIL'] . "</td>"; echo "</tr>"; } echo "</TABLE>"; mysql_close($conn); ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
psychowolvesbane Posted April 29, 2008 Share Posted April 29, 2008 Try this as well: <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Users</title> </head> <body> <TABLE> <th>ID</th> <th>NAME</th> <th>USERNAME</th> <th>EMAIL</th> <?php $user="*******"; $password="********"; $database="*********"; $conn = mysql_connect("*************" ,$user,$password); @mysql_select_db($database, $conn) or die(mysql_error); $result = mysql_query("SELECT * FROM USERS",$conn); while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['ID'] . "</td>"; echo "<td>" . $row['NAME'] . "</td>"; echo "<td>" . $row['USERNAME'] . "</td>"; echo "<td>" . $row['EMAIL'] . "</td>"; echo "</tr>"; } mysql_close($conn); ?> </TABLE> </body> </html> Quote Link to comment Share on other sites More sharing options...
psychowolvesbane Posted April 29, 2008 Share Posted April 29, 2008 PHP doesn't like echoing any of the major tags like <form> or <table> and their equivalent closing tags, it might also not like form <input>, learnt that the hard way like you about 5 months ago. Quote Link to comment Share on other sites More sharing options...
waynewex Posted April 29, 2008 Author Share Posted April 29, 2008 Psycho, you're a legend. Thanks! Quote Link to comment Share on other sites More sharing options...
psychowolvesbane Posted April 29, 2008 Share Posted April 29, 2008 No problem Don't forget to use the Topic Solved button on the bottom of the page in the thread when the problem is resolved. 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.