Thunder_Wolf Posted October 14, 2014 Share Posted October 14, 2014 I have 2 issues happening, first one I need to get resolved is, line 60 is giving me a 'Notice: Undefined variable: delete'. This codes had multi issues but was able to resolve all but this one and my table not filling in with the data from my database. If you need any other info please let me know, Again I am new at this. <tr> <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete value="delete"></td> </tr> <?php // Check if delete button active, start this*line 60* -----> if ($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM $tbl_name WHERE id='$del_id'"; $result = mysqli_query($sql); } // if successful redirect to delete_multiple.php if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=delete_multiple.php\">"; } } mysqli_close($con); ?> Quote Link to comment https://forums.phpfreaks.com/topic/291617-notice-undefined-variable-delete-in-cxampphtdocsdbmultideletephp-on-line-60/ Share on other sites More sharing options...
cyberRobot Posted October 14, 2014 Share Posted October 14, 2014 The error means the $delete hasn't been set yet. You could use isset() to test the variable: http://php.net/manual/en/function.isset.php Also, since it looks like that variable is supposed to come from an HTML form, you may want to check out the PHP manual for $_POST and $_GET. Quote Link to comment https://forums.phpfreaks.com/topic/291617-notice-undefined-variable-delete-in-cxampphtdocsdbmultideletephp-on-line-60/#findComment-1493526 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.