Deleting a record php


Posted on 16th Feb 2014 07:03 pm by admin

Attempting to setup delete a record page. The below code I put together doesn't seem to work.

| <?$delid=$_GET['delid'];echo $delid;if(isset($_POST['submit'])){$delquery="DELETE FROM table WHERE itemid = '$delid'";$dresult=mysql_query($delquery);if($picturepath1 != NULL){ unlink($picturepath); }}?><form method="POST" action=invlog.php?delid=$delid >TABLE AND FORM ELEMENTS...NOT MATERIAL SO I EXCLUDED</form>

When the delete form is initiated, the old record data is visible including the $delid; however, once I click submit I get:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/claudett/public_html/membersarea/del_exlog.php on line 21

and the reult page I include a line to echo $delid and it returns $delid (no longer includes numeric value)

I know the obvious thing would be that my mysql query syntax is off, but I think the action I set up in the <form> tag may be what I am not executing well. Any thoughts?

No comments posted yet

Your Answer:

Login to answer
242 Like 15 Dislike
Previous forums Next forums
Other forums

Problem assigning value to variable in "IF" function
Does this script makes sense? I am trying to take the value that is set to "authenticat" a

MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
We have SAP XMII 12.0 setup running on Netweaver 2004s,7.0, Java Stack only.

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

need to apply an if/else statement to Tim Thumb script
Not sure how to work this. I essentially want to call a variety of image sizes based on which style

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

output_buffering so rewrite
I'm planning to rewrite some of my scripts so they don't have to use output buffering to accomplish

PHP FTP connect doesn't work with correct login
Hi!

i am working on this test code:
Quote<?php

$ftp_ser

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash