The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Trying to delete a value in a table row from MYSQL database........
Hi Guys,
I'm attemping to delete a value from a certain row in my database (MYSQL). I have a delete.php file which should delete the league table's on my vBulletin forum. Here is the code I have in my delete.php file: PHP Code:
Any help is appreciated. |
#2
|
|||
|
|||
PHP Code:
|
#3
|
|||
|
|||
Cheers for that. Just my link now I think in the template. Here it is:
<td><if condition="$leagueid"><br /><a href="http://www.MYFORUM.com/MYFORUM/delete.php?leagueid=$leagueid">Delete</a></if> *Myforum is just an example. That is how my link is though and it don't work like delete the league after I have entered that code above in my delete.php file. |
#4
|
|||
|
|||
the code that i bring dont work?
|
#5
|
|||
|
|||
I'm not sure don't think so.
When I type in my template for the link - <td><if condition="$leagueid"><br /><a href="http://www.MYFORUM.com/MYFORUM/delete.php?leagueid=$leagueid">Delete</a></if> It says (EG) http://www.MYFORUM.co.uk/MYFORUM/del...?do=leagueid=1 on the final link before you choose to delete the league. If I entered into the delete.php file: PHP Code:
There must be a way to do this so you don't have to keep changing it. |
#6
|
||||
|
||||
Your cleaner statement is cleaning a GET variable called 'id', not 'leagueid'. Change one or the other. Also, it isn't really good practice to call both your variable $leagueid and your query $leagueid. And, your select statement makes no sense... WHERE 1? Where *what* is 1?
|
#7
|
|||
|
|||
I can now successfully delete the leagues with this PHP Code:
PHP Code:
|
#8
|
||||
|
||||
I don't know what you mean by confirmation page. If you want it so they have to first be told something like "You are trying to delete xxx from the database, are you sure you want to?" then you should have another do=whatever in your page to do that.
Also, this makes no sense: PHP Code:
PHP Code:
|
#9
|
|||
|
|||
It makes no sense but somehow it works. I don't know how but it just does
The second code I don't know what that is for but I think it makes it work. Yes I mean they have to be first be told. In which page the delete template? |
#10
|
||||
|
||||
You need to have a new do in that page. When they first click the link, they would click it to do=confirm and then the action for the form on that page would be do=delete
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|