How to run a external program in PHP?

How to create a database for program to use in MySQL?

  • Hi I'm trying to run a PHP chat bot called Program E. The installation instructions asks me to "Create a database for the program to use in MySQL". I have PHP5, MySQL, Apache2 on Ubuntu 8.10. My question is, how do I actually create a database for program E to use in MySQL as specified in the installation instructions? Thanks. Here is the actual instruction: Installation Instructions -1. If you have a previous version of Program E delete all of its files and wipe its database. 0. Prerequisites: PHP (4.0.4+) compiled --with-mysql and --with-xml and a recent version of MySQL 3.23.xx and Apache. PHP version 4.2.2 recommended. 1. Unzip all the files into a web directory. 2. Create a database for the program to use in MySQL. 3. Create the tables in the new database using db.sql which is in the sql directory. 4. By default, AIML files and startup.xml are in the aiml directory. Use the startup.xml file included in the distribution -- do not use the startup.xml you get with AIML files from alicebot.org. AIML files that work well with Program E can be found at http://sourceforge.net/project/showfiles.php?group_id=43190 5. Edit dbprefs.php with your database information and aiml directory information. If you left your AIML files in the default directory you do not have to change this. See dbprefs.php for other options you can configure. 6. The src/admin directory must be writable by the web server because botloader.php will attempt to create a file subs.inc. Or you can also create an empty subs.inc file and make it writable. 7. From your web browser, access botloader.php (in src/admin directory) to load the AIML into the database. This might take a few minutes (On a dual PIII it takes approx. 1 minute for 10,000 categories). If your PHP is running in safe mode you might need to use botloaderinc.php to load the AIML files one at a time. IMPORTANT NOTE: Whenever botloader.php is loaded it deletes all the existing patterns/templates in the database and then loads them from the AIML files. 8. Access talk.html from your web browser and say something to the bot. 9. Or access jsrschat.html in the jsrs directory from your web browser and say something to the bot. 10. Password protect your admin directory with a .htaccess file so no one can mess around with reloading your bot.

  • Answer:

    Write mysqladmin in a dos window followed by the database name you want to create C:\>mysqladmin create program_e C:\>mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 to server version: 4.0.18-nt Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SHOW databases; +----------+ | Database | +----------+ | mysql | | program_e | | test | +----------+ 2 rows in set (0.00 sec) mysql> You can also type the query in mysql> prompt like this mysql> CREATE database program_e; Query OK, 1 row affected (0.00 sec) To show available databases in mysql use the command show databases on mysql> prompt. Now use the database by typing USE program_e and then type SHOW tables to see what tables are available in the database mysql> USE program_e; Database changed mysql> SHOW tables; Empty set (0.00 sec) Run this to get the point 3 done: mysql -h program_e -u <user_name> -p <password> < db.sql

apple guava at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.