Wednesday, August 3, 2011

First success with MySQL and PHP

I discovered this neat product called DBQuikSite a couple of days ago.  It lets you create database enabled websites without much programming.  They have bundle pricing which is quite attractive.  I got it working easily with their demo within the DBQuikSite program.  The problem came when I tried to deploy the database.
It creates a folder under  
C:\Users\Athlon2011\Documents\My QwikSites\Sites\SUTIL\Deploy\PHP (1)
(since I selected MySQL and PHP for the deploy options).  The actual DBQwikSite projects are located in
C:\Users\Athlon2011\Documents\My QwikSites\Projects.

Now, since I use XAMPP, the webpages need to be in the htdocs folder
C:\xampp\htdocs\SUTIL (2)
The project I was working on involved SUTIL.  So, I copied all the files from folder (1) to folder (2).

The next problem was to actually get the database going.  DBQwikSite creates MySQL scripts which convert the MDB file it has into a MySQL database.  I had no idea how to get those scripts to run.  After some mucking around, I found out you can create a database from within PHPMyAdmin
http://localhost/phpmyadmin/

Create a new database (I named it sutil) and table (StudentChoices) with the same specs as you did in DBQwikSite:

Doing this created a new folder in the XAMPP folder (note that the mysql databases are under the data folder!)
C:\xampp\mysql\data\sutil

After all this, I managed to get the DBQuikSite php files to work
http://localhost/SUTIL/student_choices_add.php

Now, to test it live on the web, I needed a hosting service.  This webpage has a list of free websites with PHP/MySQL and I'm trying HelioHost.

I had the customary problem with not being able to access MySQL after I added a password to user localhose/root.  I had to edit C:\xampp\phpMyAdmin\config.inc.php and modify the lines