User management interface How to do, output all the user name, operation only need to delete on it

Source: Internet
Author: User
User management interface How to do, output all the user name, operation only need to delete on it
Like this.
User name action
Zhang San Delete
John Doe Delete
Harry Delete

Thank you!
------to solve the idea----------------------
List is all select out, loop output just.

If you delete it, you can pass an ID and then delete that record with SQL based on the ID.
------to solve the idea----------------------
List page

/* User table structure
Id
Name
*/

Database connection

$SQLSTR = "SELECT * from user";
$query = mysql_query ($sqlstr) or Die (Mysql_error ());

Echo '





'; Echo ' ' while ($thread = Mysql_fetch_assoc ($query)) { echo ' ';} Echo '
User name Operation
'. $thread [' name ']. ' Delete
';

?>


Delete Page

Database connection

$id = Isset ($_get[' id ')? $_get[' id ']: 0;
$sqlstr = "Delete from user where id= '". Intval ($id). "'";
mysql_query ($sqlstr) or Die (Mysql_error ());

Echo ' Delete succeeded ';

?>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.