|
|
horsefactory
from 💠 (United Kingdom) on 2004-05-26 05:01 [#01208012]
Points: 14867 Status: Regular
|
|
This is probably really dumb but I don't think I am looking at it the right way at all. What I need to do is perform an SQL (delete row) query by clicking on a link. I have the php function defined for the database connection and the query and stuff but I don't get how I can execute it when I click a link. If I have it in a file, say 'delete.php' and link to that, what is the syntax and how can I pass a parameter to it (to specify which row needs to be deleted) ?
Any help is appreciated, thanks.
|
|
Drunken Mastah
from OPPERKLASSESVIN!!! (Norway) on 2004-05-26 05:12 [#01208018]
Points: 35867 Status: Lurker | Show recordbag
|
|
I think you'll need to do it by either having the link point to "yourfile.php?delete=yes" and have the script detect whether or not $delete is set, or you'll have to use a form.
|
|
aphextriplet
from your mothers bedroom (United Kingdom) on 2004-05-26 05:14 [#01208021]
Points: 4731 Status: Lurker
|
|
you should be able to find apt code online, it'll just have little comments on where to input your personal data eg database name etc.
|
|
horsefactory
from 💠 (United Kingdom) on 2004-05-26 05:21 [#01208036]
Points: 14867 Status: Regular
|
|
Ah, I've done it. Made the link point to 'delete.php?del=$key. Thanks guys.
|
|
aphextriplet
from your mothers bedroom (United Kingdom) on 2004-05-26 05:22 [#01208039]
Points: 4731 Status: Lurker
|
|
i didnt really help, moreover tried to look clever by pretending to help. That's why i teach.
|
|
Drunken Mastah
from OPPERKLASSESVIN!!! (Norway) on 2004-05-26 05:22 [#01208043]
Points: 35867 Status: Lurker | Followup to horsefactory: #01208036 | Show recordbag
|
|
I've had trouble with that myself a few times.. I couldn't figure out how to point a LINK instead of a form to make a difference on a script, but the answer is so simple, really.
|
|
Messageboard index
|