Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Drop Database on click
Old 10-24-2008, 10:14 AM Drop Database on click
Novice Talker

Posts: 14
Name: Matthew Laver
Trades: 0
Hi there guys, probably a quick question for someone. I have a little gallery that suck in pictures from flickr, caches them to a mysql database and displays them via lightbox.

But whenever I change the flickr pics referenced I have to manually go into my mysql db and drop the database table so that the images will be re-cached.

Is there a way I could create a button that would do this for me?

Thanks in advance.

Matthew
Mr Batman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-24-2008, 10:24 AM Re: Drop Database on click
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
This should do it. Obviously don't put the form somewhere public, and you may want to include some javascript to prompt you before droping the table. Here is a minimal example of how to do this:

Code:
<form action="droptable.php" method="post">
<input type="submit" />
</form>
PHP Code:
<?php
//droptable.php

//connect to your database here

$sql 'drop table if exists `tablename`;';
mysql_query($sql);
?>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by NullPointer; 10-24-2008 at 10:24 AM.. Reason: fixed tags
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-10-2008, 09:03 AM Re: Drop Database on click
Novice Talker

Posts: 14
Name: Matthew Laver
Trades: 0
Thanks allot NullPointer that worked a treat!
Mr Batman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Drop Database on click
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.41680 seconds with 12 queries