NameSilo

Help me with MySQL

Spaceship Spaceship
Watch

Domains4u

Account Closed
Impact
3
Hi all

I own www.UKGMC.com which is a radio directory, but its also a working project, im going to be working with it for a good year or so until i develop a unique type of script that can be used like PHPBB (open source).

To jump to the point, ive write some working code in MySQL which is what you see when you click on the site above. With the help of a nampros member ive added a anti-duplication script to it, that stops users from refreshing the page and adding more submitions (basiclly flooding the page with crap), but that dosnt stop them adding junk manually.

So what i want to do now is add an admin page that will look EXACTLY the same except next to every entry there will be a Delete link, that deletes the entry, im maybe thinkking some check boxes to delete multiple entrys. But this will only be available in the admin/index.php part of the site, which ill have password protected.

Has anyone got any tutorials on the internet or any recourses that might help me to add a delete link to my code so that i can delete entrys without having to manually enter code?

Thanks for looking and i hope you can help.


D4U
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
mysql is not a programming language you need php to do something like that.
 
0
•••
Well, on your admin index page just have a loop grab all the urls, like:

PHP:
$query = mysql_query("SELECT * FROM urls") or die("Error: ".mysql_error());

while($row = mysql_fetch_array($query))
{
  echo $row['url'].' <a href="?delete=yes&id='.$row['id'].'">Delete</a><br>';
}

if($_GET['delete'] == "yes")
{
  $id = intval($_GET['id']);
  $query = mysql_query("DELETE FROM urls WHERE id = $id LIMIT 1") or die("Error, couldn't delete");
}

Err, something close to that ;)
 
0
•••
Amnezia said:
mysql is not a programming language you need php to do something like that.

I am using PHP :)


Well, on your admin index page just have a loop grab all the urls, like:

Thats sort of what i was looking for, ill look into it now ive got a base to work off. Couldnt find how to do it in my PHP books.

Thanks SV.....saved the day........................again!
 
0
•••
Have you considered validating and checking for duplicates before they're entered into the db?
 
0
•••
Pain yer, ive already got that sorted :)

Im just trying to create an admin page to delete unwanted posts.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back