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

Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

How to return to a previous page after running a PHP script
I'm having a bit of a melt down here because I think this should be really easy but can't work it ou

How can I get my program to read a larger array ??
Hi:

I have this program that reads from an array to do calculations. The array are just t

Lack of simpleXML Documentation
What is up with this.

Look at: http://www.php.net/manual/en/function.simplexml-load-file.php<

Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders

url- go to webpage
i have an input text field and submit button.

how do i make the url entered into the textfiel

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

PHP template help
Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie an

Simple code help with redirects
I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redi

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