PHP Scripts Development » General Web Development Forum

php , SQL file n Mysql database

(8 posts)

Tags:

Great offers not only for geeks!


  1. User has not uploaded an avatar

    hmvrulz
    Member

    i have a sql file with all the required queies... how can i with php make the connection to mysql n create tables n insert the values

    DROP TABLE IF EXISTS ip2nation;
    
    CREATE TABLE ip2nation (
      ip int(11) unsigned NOT NULL default '0',
      country char(2) NOT NULL default '',
      KEY ip (ip)
    );
    
    DROP TABLE IF EXISTS ip2nationCountries;
    
    CREATE TABLE ip2nationCountries (
      code varchar(4) NOT NULL default '',
      country varchar(255) NOT NULL default '',
      lat float NOT NULL default '0',
      lon float NOT NULL default '0',
      PRIMARY KEY  (code),
      KEY code (code)
    );
    INSERT INTO ip2nation (ip, country) VALUES(0, 'us');
    INSERT INTO ip2nation (ip, country) VALUES(687865856, 'za');
    INSERT INTO ip2nation (ip, country) VALUES(699400192, 'eg');
    INSERT INTO ip2nation (ip, country) VALUES(699465728, 'za');
    INSERT INTO ip2nation (ip, country) VALUES(699531264, 'eg');
    INSERT INTO ip2nation (ip, country) VALUES(700448768, 'za');
    INSERT INTO ip2nation (ip, country) VALUES(700710912, 'eg');
    Posted 6 months ago #
  2. Hi, just import the sql via phpmyadmin

    Posted 6 months ago #
  3. User has not uploaded an avatar

    hmvrulz
    Member

    no i am creating a script for others also so tht it can be done on the fly.. just like click install n the stuff is done...
    isnt it possible

    Posted 6 months ago #
  4. Quote from: hmvrulz
    "no i am creating a script for others also so tht it can be done on the fly.. just like click install n the stuff is done...
    isnt it possible"

    you ask me on how-to create a install script that you will provide to others?

    Posted 6 months ago #
  5. User has not uploaded an avatar

    hmvrulz
    Member

    Quote from: Olaf
    "you ask me on how-to create a install script that you will provide to others?"

    practically ya. but am asking how to do it via the sql file

    Posted 6 months ago #
  6. just for your info, a sql (dump) file has only sql instructions, you need a php script to execute these instructions.

    I don't write custom scripts for free, try it by yourself and maybe someone will help you with your code.

    Posted 6 months ago #
  7. User has not uploaded an avatar

    hmvrulz
    Member

    Quote from: Olaf
    "just for your info, a sql (dump) file has only sql instructions, you need a php script to execute these instructions.
    I don't write custom scripts for free, try it by yourself and maybe someone will help you with your code."

    ok... can u please guide me on wht i need to do..

    Posted 6 months ago #
  8. Quote from: hmvrulz
    "
    ok... can u please guide me on wht i need to do.."

    you could start reading a book about PHP ;)

    what do you think? that I teach you here to learn everything?

    Posted 6 months ago #

RSS feed for this topic

Reply

You must log in to post.