buddhi225 Posted May 31, 2009 Share Posted May 31, 2009 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 More sharing options...
anupamsaha Posted May 31, 2009 Share Posted May 31, 2009 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. Link to comment https://forums.phpfreaks.com/topic/160355-setting-up-database-install-file/#findComment-846238 Share on other sites More sharing options...
gevans Posted May 31, 2009 Share Posted May 31, 2009 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] Link to comment https://forums.phpfreaks.com/topic/160355-setting-up-database-install-file/#findComment-846293 Share on other sites More sharing options...
Ken2k7 Posted May 31, 2009 Share Posted May 31, 2009 Wouldn't that mean the user would have to have MySQL server installed on their computer as well as PHP and maybe even PHP-MySQL? Link to comment https://forums.phpfreaks.com/topic/160355-setting-up-database-install-file/#findComment-846296 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.