Go Back   Cloud Computing > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 08-12-11, 01:12
BOD Member
 
Join Date: Aug 2011
Posts: 76
Default Drop Database on click

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.
Reply With Quote
  #2 (permalink)  
Old 08-12-11, 10:37
BOD Member
 
Join Date: Jul 2011
Posts: 68
Default

Before going to drop the table, include javaScript and make sure you do not place the form somewhere public.

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

//connect to your database here

$sql = 'drop table if exists `tablename`;';
mysql_query($sql);
?>
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 01:14.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.