Jump to content

Setting up database install file


buddhi225

Recommended Posts

Hi people,

 

I have created a small offline program. How can I quickly install the database on someone Else's computer from a php file.

 

" databaseinstall.php "

So when they view that in their browser it sets up the database.

 

I have the database dump information.

 

-- phpMyAdmin SQL Dump
-- version 3.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 30, 2009 at 10:34 AM
-- Server version: 5.1.30
-- PHP Version: 5.2.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `name`
--
CREATE DATABASE `name` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `name`;

-- --------------------------------------------------------

--
-- Table structure for table `veges`
--

CREATE TABLE IF NOT EXISTS `veges` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `M` tinyint(2) NOT NULL,

 

Will I have to type everything up with php, running queries? or is there a faster way to do this straight from the SQL file?

Link to comment
https://forums.phpfreaks.com/topic/160355-setting-up-database-install-file/
Share on other sites

Hi people,

 

I have created a small offline program. How can I quickly install the database on someone Else's computer from a php file.

 

" databaseinstall.php "

So when they view that in their browser it sets up the database.

 

I have the database dump information.

 

-- phpMyAdmin SQL Dump
-- version 3.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 30, 2009 at 10:34 AM
-- Server version: 5.1.30
-- PHP Version: 5.2.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `name`
--
CREATE DATABASE `name` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `name`;

-- --------------------------------------------------------

--
-- Table structure for table `veges`
--

CREATE TABLE IF NOT EXISTS `veges` (
  `id` int(2) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `M` tinyint(2) NOT NULL,

 

Will I have to type everything up with php, running queries? or is there a faster way to do this straight from the SQL file?

 

Interesting !!!

Do you want to create a database to a client's computer by using a PHP script? Need more information w.r.t. the "offline program". Basically, PHP is a server-side script. Never meant to do any "installation" type task in client-side.

 

I'd recommend finding a third party php app that you're comfortable with, and that uses a db and see how they do it. I've attached a php file that an old php forum install used to work. It should give you an idea. Everything is done through mysql queries.

 

[attachment deleted by admin]

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.