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>

Did you know?Explore Trending and Topic pages for more stories like this.
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

Batch Session SM35 stuck in status 'in Background
Hi Experts,

I am facing a problem with Batch Input session SM35.

The batch se

upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som

Remove directories not empty
hi,
i have an array that contains some names (1,4,6,56...). Every integer is a name of a folder.<

modifying a property of an object from a different class
I have 2 classes:
- Math
- Distance

in my math class, I have this line:
$distance =

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

Format timestamp from mysql
When I tried this:
Code: date("m/d/Y H:i A", $row['timestamp'])
I got 12/31/1969 18:

Not loading image
When this function gets loaded it doesn't load the image just trying to figure out why.

Code:

need help in update query
i create a form for update. there are 8 columns in my mysql table. on my main page all the data is r

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Binding 2 UDP sockets on same port, connected to different destinations, 1 receives
Hello,
My application wants to send/recv data to 2 different UDP ports on a remote computer, us

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