Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'view_users.php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. I have a quick question about chapter 10, script 10.1 view_users.php; I updated the view_users.php via the script 10.1, when I executed the script, the Labels did not line up properly; Last Name, First Name, Registration Date is not in the appropriate place, they are to the far left, right below Edit. I have not made any changes to the script or to the css that I have downloaded from this site. The last view_users was visually correct and so is the home page. I am not sure why these labels are out of place and unsure of how to correct them. The books say to align to the left but I believe that is referring to inside of its header. Edit & Delete are in their respectable places. <?php # script 9.6 - view_users.php // This script retrieves all the records from the users table $page_title = 'View the Current Users'; include ('include/header.html'); // Page header echo '<h1>Registered Users<h1>'; require ('mysqli_connect.php'); // connect to database // DEFINE the query Make the query: /* original script below $q = "SELECT CONCAT(last_name, ', ', first_name) AS name, DATE_FORMAT(time, '%M %d, %Y') AS dr FROM users_info ORDER BY time ASC"; */ // make/define the query $q = "SELECT last_name, first_name, DATE_FORMAT(time, '%M %d, %Y') AS dr, user_id FROM users_info ORDER BY time ASC"; $r = @mysqli_query ($dbc, $q); // Run the query $num = mysqli_num_rows($r); if ($num > 0) { // If it ran OK, display the records. echo "<p>There are currently $num registered users</p>\n"; // Table header echo '<table align="center" cellspacing="3" cellpadding="3" width="75%"> <tr> <td align="left"><b>Edit</b></td> <td align="left"><b>Delete</b></td></tr> <td align="left"><b>Last Name</b></td></tr> <td align="left"><b>First Name</b></td></tr> <td align="left"><b>Date Registered</b></td> </tr> '; // Fetch and print all the records: while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { echo '<tr> <td align="left"><a href="edit_user.php?id=' . $row['user_id'] . '">Edit</a></td> <td align="left"><a href="delete_user.php?id=' . $row['user_id'] . '">Delete</a></td> <td align="left">' . $row['last_name'] . '</td> <td align="left">' . $row['first_name'] . '</td> <td align="left">' . $row['dr'] . '</td> </tr> '; } echo '</table>'; // Close the table mysqli_free_result ($r); // Free up the resources. } else { // If no records were returned // public message: echo '<p class="error">There are currently no registered users. Step yo game up!</p>'; //Debugging message: // echo '<p>' . mysqli_error($dbc) . '<br /><br />Query: ' . $q . '</p>'; } // End of if ($r) IF. mysqli_close($dbc); // close the data connection. include ('include/footer.html'); ?> Thank you
  2. On the view_users.php page, when you click on the "Edit" link you are redirected to another page using the user_id being passed to next page within the URL. On page 260 we are told of the first method in which uses the hidden input type for forms, how can we apply this method to the "Edit" link hyperlink and what adjustments would need to be made to the view_users.php script to allow this ?
×
×
  • Create New...