[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 02-11-2006, 09:22 AM   #1 (permalink)
Account Suspended
 
Domains4u's Avatar
 
Join Date: Nov 2005
Location: www.TFFH.net
Posts: 280
58.80 NP$ (Donate)

Domains4u has a spectacular aura aboutDomains4u has a spectacular aura about


Help me with MySQL

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
Domains4u is offline  
Old 02-11-2006, 09:24 AM   #2 (permalink)
Professional Monkey
 
Amnezia's Avatar
 
Join Date: Jul 2005
Location: Escaped from the zoo
Posts: 908
13.25 NP$ (Donate)

Amnezia has a spectacular aura aboutAmnezia has a spectacular aura about

Cancer Survivorship Save a Life
mysql is not a programming language you need php to do something like that.
__________________
[http://www.webmasterwords.com/python-split-and-join-examples]Python Tutorials[/url]
Amnezia is offline  
Old 02-11-2006, 09:35 AM   #3 (permalink)
NPQ's PA, Slave, and On Call Coder

Technical Services


 
Eric's Avatar
 
Join Date: Mar 2005
Posts: 4,545
0.71 NP$ (Donate)

Eric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond reputeEric has a reputation beyond repute

Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse
Well, on your admin index page just have a loop grab all the urls, like:

PHP Code:

$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
__________________
Eric is offline  
Old 02-11-2006, 09:38 AM   #4 (permalink)
Account Suspended
 
Domains4u's Avatar
 
Join Date: Nov 2005
Location: www.TFFH.net
Posts: 280
58.80 NP$ (Donate)

Domains4u has a spectacular aura aboutDomains4u has a spectacular aura about


Quote:
Originally Posted by Amnezia
mysql is not a programming language you need php to do something like that.
I am using PHP


Quote:
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!
Domains4u is offline  
Old 02-11-2006, 10:12 AM   #5 (permalink)
NamePros Regular
 
Join Date: Jun 2003
Location: Louisiana, USA
Posts: 665
33.75 NP$ (Donate)

painperdu has a spectacular aura aboutpainperdu has a spectacular aura about


Have you considered validating and checking for duplicates before they're entered into the db?
__________________
******dotbob.com******
Cheap Domain Name Registrations
**** -Dotbob.com
painperdu is offline  
Old 02-11-2006, 01:07 PM   #6 (permalink)
Account Suspended
 
Domains4u's Avatar
 
Join Date: Nov 2005
Location: www.TFFH.net
Posts: 280
58.80 NP$ (Donate)

Domains4u has a spectacular aura aboutDomains4u has a spectacular aura about


Pain yer, ive already got that sorted

Im just trying to create an admin page to delete unwanted posts.
Domains4u is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: Install the Apache Web Server, Perl, PHP, and MySQL on Windows deadserious Webmaster Tutorials 96 05-27-2007 01:24 PM
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 01:17 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 04:41 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85