top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

PHP: Create a local temp table in local machine

+1 vote
449 views

I need create a local table on the local machine. I would like to know is it possible to down on server side or client side or jQuery to do the work.

posted Sep 28, 2013 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

If you're looking to create a SQl table then most but not all browsers can use SQLite locally for data storage ( it does require newer browsers).

You haven't stated the goal for this so other options could include sending csv or json data down to the browser and using jquery, angular or some other JS framework to manipulate that data may also be an option

answer Sep 28, 2013 by anonymous
Thanks for the message and help, because I use jQuery autocomplete which has performance issue for thousands records due to network load data.
I want to load the data to local table to resolve performance issue, if it possible I can load to an array in the memory.
I had exactly this situation, large list with the autocomplete. I cached the list to a JS file and ran the autocomplete from that. It works well if the list is relatively static which mine was. It will be tougher if the list is dynamic, but you could send the data down after the initial page load.
Similar Questions
+2 votes

How I 'll check how many rows inserted into every second on an average in a table of MySQL database?

+1 vote

I am tring to create a new table into the database if the table name given is not present in database using Php .
This is the code that I am using .

  $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    if(!$conn)
    {
            die('Failed to connect to server: ' . mysql_error());
            exit;
    }
    $db_selected = mysql_select_db($dbname);
    if(!$db_selected)
    {
           $db_selected = " CREATE DATABASE $dbname ";
    }
    $usertb1 = mysql_query("select 1 from $usertb LIMIT 1");
    if( $usertb1 !== FALSE )
    {
           $sql = "CREATE TABLE IF NOT EXISTS $usertb ( uid INT(20) AUTO_INCREMENT UNIQUE KEY NOT NULL,name VARCHAR(40),email varchar(40) PRIMARY KEY NOT NULL)";
    }
    $typetb1 = mysql_query("select 1 from $typetb LIMIT 1");
    if( $typetb1 !== FALSE)
    {
           $sql1 = "CREATE TABLE IF NOT EXISTS $typetb( uid INT(20) NOT NULL, type ENUM('WEB','APP','CART') NOT NULL ,unsubscribe TINYINT(1) NOT NULL,bounce TINYINT(1) NOT NULL,complaint TINYINT(1) NOT NULL, PRIMARY KEY (uid,type), FOREIGN KEY(uid) WHERE promo_user(uid))";
    }
...