Jump to content

Register


stanleybb

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.