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. Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476074 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'); ?> Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476075 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 Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476101 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. Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476114 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? Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476118 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 Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476121 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? Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476123 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. Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476126 Share on other sites More sharing options...
stanleybb Posted February 25, 2008 Author Share Posted February 25, 2008 PHP.ini where is that? Link to comment https://forums.phpfreaks.com/topic/92908-register/page/2/#findComment-476133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.