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

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

DOMDocument
Hello All,

I need to take an XML document, modify some of the nodes in it and then perform a

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

Get content from table into a list, without repeating.
Alright this is kinda an odd thing, so I need some help.

I have a table "quote" wit

mySQL and PHP search
Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty

New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code righ

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

C - Reading a file into a byte array
Hi,

I'm trying to read a file into a byte array in C. I have to use C as this is for a loadru

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

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