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

Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes

I need to increse 6hours more, and i don't know how???
I need to increse 6hours more, and i don't know how???
<tr>
<t

MS are the best!!!
Visit http://www.microsoft.com/australia/windows/default.aspx?h=watch-a-demo and click the massive '

login box shows up again after logging in 2nd login works
Hello,

I am having trouble on my site Lockerz.rack111.com where when you login the login box

Update not working ... please help
Hi,

I am trying to update a row using an edit form by passing id of the row .. but it is not

ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
database : XE

there is a table (transito) with two fields of clob

Does deleting the spmlog directory critical?
Hi Everyone,

Please, hope you could help me. We're having problems with the SAP backup. I

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

Need help PLEASE
ok i have this warning showing up

Warning: in_array() [function.in-array]: Wrong datatype for

PHP and SMS
Hi all forum members. I am new here and am unsure what category shoild I post this in.
Moderator

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