PHP-eSeller

A question I am often asked is how can I create better reports from the data that is in the mySQL database for transactions processed by PHPeSeller or by PHPSecureArea. Both of these have sales history displays but you may wish to process the data in another application such as MS Excel or MS Access.

One approach is to extract the data from mySQL using your web server control panel. Login into the control panel of your server and find the section that deals with mySQL. You should have a link to myPHPAdmin or a similar database tool.

Navigate to the correct database in myPHPAdmin. Navigate to the table that you want to export and at the top of the page you should see an EXPORT tab. Click on this. You will need to select a particular format for the export. This is normally CSV for Excel or CSV. CSV stands for Comma Separted Values and is a very common method of transfering data to and from different application. That should then allow you to download the file which can then be opened in your required application.

Once you’re in the “hosting control center” click on “mysql” from the “databases” dropdown menu

Click the “create database” button

Choose MySQL version 4 or 5, and then enter a description (can be anything), database/user name (must be very unique, or you’ll have to try again), and password (must use at least one capital letter and a number)

(NOTE: you may have to wait 5-10 minutes while the database is setup )

Click the little pencil icon to edit/view database details

Write down or copy the “Host Name:” this will go in the wp-config.php file in place of “localhost”

In your web browser, go to the installation script install.php and fill in the details:

This tutorial will take you step-by-step through the process of creating a database for use with withinweb applications using CPanel.

First, login to your cpanel control panel.

You should see a large number of icons, one of which will be mySQL Database

Click on this and you will be taken to the mySQL Account Maintenance page. You may also see other database details listed if you have created other database before.

Add User

You need to first add a user name and a password.

Click the Add User button

Note that your host will usually add a prefix to the user name, so this will become something like wptemp_Podz

Create your database

You should now be looking at the screen below. Note that you – the User – are listed in a box at the top, and also below the line too.

Enter the name of the database where database name is listed. Then click Add Db

The database is now created.

Allocate the user to the database

The two pieces of information you just added are now here on this screen: the user name and the database name.

If you have other databases and users, the whole screen may look different, but this small part will look the same.

Look at the two drop-down boxes.

The User box MUST contain the name that you added first above. (Note that for each name you put in, the CPanel has added a prefix.) If you need to, click the drop down to get the name you added to appear in the left hand box. The same applies to the database: – get the name of the database in the box too.

When finished, click the button that says Add User to Db.

This is REALLY important – nothing will work unless you click that button.

You should see this.

At this point you have created the database, created a user and allocated the user to the database.

You can now create the tables using the install.php script supplied with the zip file.

You will need to have the following information available :

database name
database username
database password
database host (usually local host but refer to your host documentation if you are not sure)

When you run the install.php file in your browser you will be presented with boxes as follows :

With PHP-eSeller, If you have items in category / subcategory and you wish to analyse the items sold per categtory / subcategory, then one method is to use a SQL View and export the data to a spreadsheet.

A SQL View is like a query in MS Access. It is a combinations of a number of tables which gives you a much more convenient display.

However, Views are only supported on mySQL version 5 and above so you need to be using that version.

To create a view, go to your PHPMyAdmin interface on your server, go to the database where PHP-eSeller tables are located and in a SQL query box copy the following text :

With PHP-eSeller, PHP-SecureArea or PHP-KeyCodes, if you get an error during installation where the admin keeps on logging out, it is usually because there is an issue with session variables on your server.

First check using the test file a_session_test.php When the page is first loaded there will be a link, click the link and it should say ‘Welcome back’. If it does not, then it means there is a sessions issue on your server.

There could be a number of reasons for this, usually it is caused by a configuration problem on the server. There should be a folder on the server which is used to store sessions and somtimes the host has not set this correctly. Or it could be that it is a shared server and the server does not know the path.

Contact your hosting and ask them to investigate.

Sometimes they will reply that you include the following code at the top of any PHP script that uses sessions:

session_save_path(“path to session folder”);

If you use session_save_path on the page that registers a variable, you have also to use session_save_path on all the pages, where you access the session-variable. Under win32 you can use the double \\ to specify eg “c:\\temp\\”

This is possible to do but is not really practical.

If they do reply with the above, it is worth asking them again to check the php.ini configuration and also ask if there is a global method where you can set the path and where you do not have to change every instance in the application.

One possible solution is to set the session.save_path in an .htaccess file. You may not have access to the php.ini file so this may be the way to do it. You can do that in the .htaccess file, which is kind of configuration file for Apache, and put it in your root web folder.

If you add :

php_value session.save_path /home/groups/f/f4/f4l/tmp/

where the folder name is the absolute path to the folder. You should be able to get the absolute path by logging into your control panel.