Jump to content

temporay mysql database table in php cheers...


redarrow

Recommended Posts

advance thank you........

 

I just created this very easy code to submit and create a temporay

database table for a basket..........

 

i want to no how long does a temporay table last.......

 

how does it all work ......

 

does it delete afther submission............

does it delete info afther submission..........

does it delete afther the next submission.........

do i delete it ( but it tempory )

 

please help cheers.......

<?php

$db=mysql_connect("localhost","username","password");
$db_result=mysql_query_db("database_name",$db);

if(!$db_result){

echo"DATABASE CONNECTION PROBLAM";
}

if(isset($_POST['submit'])){

$sql = 'CREATE TEMPORAY TABLE `barsket` (
        `id` TINYINT( 3 ) UNSIGNED NOT NULL AUTO_INCREMENT,
        `product` VARCHAR( 150 ) NOT NULL,
        `price` INT( 10 ) NOT NULL,
        `description` TEXT( 250 ) NOT NULL,
        `date_added` INT( 25 ) NOT NULL,
        `date_sold` INT( 25 ) NOT NULL,
        `confirm` CHAR( 3 ) NOT NULL,
        PRIMARY KEY ( `id` ))';

$sql_result=mysql_query($sql)or die(mysql_error);

       echo 'Creating table: \'Barsket\'....';
}

?>

<form method="POST" action="">
<input type="submit" name="submit" value="CREATE TEMPORAY TABLE">
</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.