In the following code I try delete a record from my database but it doesnt work... I dont know why
Thank you in advance
<?php
ob_start();
session_start();
require_once 'dbconnect.php';// it will never let you open index(login) page if session is setif(!isset($_SESSION['user'])){
header("Location: home.php");exit;}
$error =false;if( isset($_POST['submit'])){if(empty($_POST['ID'])){
$error =true;
$emailError ="Please enter an ID ";}// prevent sql injections clear user invalid inputs
$ID = trim($_POST['ID']);
$ID = strip_tags($ID);
$ID = htmlspecialchars($ID);if(!$error){
$result=mysqli_query($conn,"SELECT userName, userEmail , userPass FROM users WHERE userName='$ID'");
$row=mysqli_fetch_array($result);
$Count= mysqli_num_rows($result);if($Count ==1){
$result=mysqli_query($conn,"DELETE * FROM users WHERE userName='$ID'");
$row=mysqli_fetch_array($result);
$errMSG="User Deleted!";}else{
$errMSG ="User doesnt exist";}}}?>
First time clicking on a Sayan Sen article after he started making clickbait, vague headlines recently. Didn't read, just came here to say the headline doesn't look like very cheap, vague clickbait this time. Are you okay?
Good review, and yeah the benchmark breakdown is pretty clear but also a little messy in a good way. It’s kinda interesting to see where the RX 9070 GRE slides in between the 7800 XT and the 9070 XT , especially when it comes to AI tasks and Blender style workloads. The side by side with Nvidia’s RTX 5070 and 4070 makes it feel obvious just how competitive the mid range GPU scene has gotten lately, and that’s great for creators and gamers too since you can pick based on your priorities rather than only chasing one single thing.
That's it. I finally uninstalled Firefox because they often keep pushing buggy updates, only to test them later and make users suffer. No longer is it my alternative browser to Edge. What a waste of energy. Firefox is bad for the environment, just like Chrome (wasting RAM/energy).
Recent Achievements
Supreme Spray LV earned a badge Week One Done
Genuinetonerink- Dubai earned a badge One Month Later
Genuinetonerink- Dubai earned a badge Week One Done
Question
GeekInside
In the following code I try delete a record from my database but it doesnt work... I dont know why
Thank you in advance
Edited by GeekInsideLink to comment
https://www.neowin.net/forum/topic/1356812-mysql-query-doesnt-work-help-needed/Share on other sites
2 answers to this question
Recommended Posts