php tutorial mysql tutorial to delete records (url value delete data 0 This section to delete the data code is based on the user url address bar passed parameters, go to the mysql database tutorial delete operation oh. * /
/ / First determine whether the id of the user $ sql = "select * from users where id = $ id"; $ result = mysql_query ($ sql) or die ("error: <b>". mysql_error (). "</ b> sql:". $ sql); if (! mysql_num_rows ($ result)) { echo 'user id error! '; exit }
// delete user data $ sql = "delete from users where id = $ id"; mysql_query ($ sql) or die ("error: <b>". mysql_error (). "</ b> sql:". $ sql); mysql_close ($ conn);
echo 'data deleted successfully, return <a href="13-12.php"> 13-12.php </a> to view the data';
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.