Jump to content

Search the Community

Showing results for tags 'drop table'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. //CHECK TO SEE IF TABLE ALREADY EXISTS TO THE DATE if($TABLE_NAME == $date){ // IF EXISTS THEN DROP THE TABLE echo 'THIS DATE ALREADY EXISTS <br>'; $drop_table = "DROP TABLE` " .$date."`"; mysql_query($drop_table); echo '<h4>THE TABLE HAS BEEN DROPPED</h4><h5>NOW SELECT THE FILE YOU WANT TO CREATE</h5>'; } else{ // CREATE THE NEW TABLE $create_table = "CREATE TABLE `".$date."` ( `entry_id` int(11) NOT NULL, `transaction_id` varchar(55) NOT NULL, `name` varchar(255) character set latin1 default NULL, `price` varchar(11) character set latin1 default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8"; mysql_query($create_table); echo 'NEW TABLE HAS BEEN CREATED PLEASE MOVE TO NEXT STEP'; } $run_q = mysql_query($create_table); $return = '<h4>FILE THAT YOU SELECTED:</h4>' . $_FILES['file']['name']; $file = $_FILES['file']['tmp_name']; $handle = fopen($file,"r"); while(($fileop = fgetcsv($handle,1000,",")) !== false){ $name = $fileop[0]; $price = $fileop[1]; $t_id = $fileop[2]; $ship_method = ''; $cc = ''; $address = ''; $city = ''; $state = ''; $cc = ''; $email = ''; $p_name = ''; $p_quantity = ''; $total = ''; $id = ''; $date = ''; } I can't seem to get the DROP TABLE query to execute through PHP. It is not a multiple query or anything that would create confusion, and when imputed into SQL directly fire correctly. Any suggestions ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.