deansatch Posted February 25, 2008 Share Posted February 25, 2008 Also, try removing this line: if(isset($_POST['submitted'])) { and the last line: }// End of the main Submit conditional. Quote Link to comment Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 this bit of code is suppose to show list the users in the table users (on database) but that doesnt work either, there must be a link why it aint working <?php $page_title = 'View the current users'; include ('./includes/header.html'); echo '<h1 id="mainhead">Registered Users </h1>'; require_once ('../mysql_connect.php'); $query = "SELECT CONCAT(last_name, ',', first_name) AS name, DATE_FORMAT (registration_date, '%M %d, %Y') AS dr FROM users ORDER BY registration_date ASC"; $result = mysql_query ($query); if($result) { echo 'table align="center" cellspacing="0" cellpadding="5"> <tr><td align="left"><b>Name</b></td><td align+"left"><b>Date Registered</b></td></tr> '; while($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { echo '<tr><td align="left">' . $row['name'] . '</td><td align="left">' . $row['dr'] . '</td></tr> '; } echo'</table>'; mysql_free_result ($result); } else { echo '<p class="error"> The current users could not be retrieved.</p>'; echo '<p>' . mysql_error() . '<br /><br />Query: ' . $query . '</p>'; } mysql_close(); include ('/includes/footer.html'); ?> Quote Link to comment Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 it doesnt display errors, it works but doesnt save to database Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted February 25, 2008 Share Posted February 25, 2008 try rewriting mysql_query($query); to mysql_query($query) or die($query.'<br>'.mysql_error()); And see if an error is returned that way. Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 There is nothing in that code that actually writes anything to the DB. Not sure what you were expecting? Quote Link to comment Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 i have tried that way, but it works nad no error is displayed Quote Link to comment Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 what is the register.php there is nothing what writes to the DB? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 25, 2008 Share Posted February 25, 2008 Check your PHP.INI and make sure error reporting is turned on. Echo your querries and makes sure everything looks ok. Quote Link to comment Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 PHP.ini where is that? 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.