php - entering a number into a query -
i've been stuck @ while , i'm sure simple fix can't find answer it.
i'm trying remove row in table variable i'm putting query isn't being recognized. in $remove query below, if enter number corresponds row query works fine, when use variable won't.
if (isset($_post['remove'])) { $remove = $_post['remove']; //echo $remove; print number entered $query ="delete dogid regdogs dogid = $remove "; if($query_run = mysql_query($query)){ $query_num_rows = mysql_num_rows($query_run); if($query_num_rows==1) echo 'entry removed '; else echo 'not removed '; }
thanks
$query ="delete regdogs dogid = $remove ";
try this. syntax error.
again, please move mysqli_ methods. mysql_ methods deprecated.
Comments
Post a Comment