MySQL question.

Status
Not open for further replies.

Spike

Posts: 2,122   +0
In my little web project that's about to be started, I'm condsidering two different pieces of software, being OsCommerce, and phpBB2.

Both of these are PHP based softawres, and both of these require a MySQL database.

At the moment, I'm getting ready to start putting this project together. I've installed Apache, and I'm downloading PHP 4 at this very moment, which I'm about to install onto Apache

The problem is twofold. I know very little about MySQL, and so I'm wondering if there's anything I need to do to enable it on my apache server?

The other issue, is that the host I'm thinking of using offers only 1 MySQL database for the price plan I would like to use. I was wondering then, whether it would generally be possible to set up OScommerce, and then use the same Db to install phpBB2, or vice versa. If it is, in time I may even be able to link the two by user-account (ie, one single sign in - once I know a little more). Alternatvely, is it the case that this is not possible, and I would have to go with a higher hosting plan to use a second database, and if so, would there be any way of linking the two pieces of software (not specifically, but purely in theory) to create a single sign-in scenario?
 
You don't have to know anything about MySQL to set up a program that uses it. Most solutions just want to know the database server, the username, password and the database name to use and will set themselves up automagically.

The one database in a web service is not about mysql instances. It is the amount of databases you can create inside the mysql instance.

I suppose you could tell both your programs to use the same database (give them the same database name they should use). It can only work if the programs don't have any tables with the same names. If phpBB2 and OScommerce both have a table called "users" but the the table format is different then you are in big trouble.

The possibility of a single sign-in depends heavily on the specific pieces of software and their configurability.
 
That's brilliant! thankyou very much!!!!

I guess the only thing left ot ask then, would be that in the case of the single sign in, If all else failed, would it be a straightforward (though possibly long winded) matter of changing the registration and and login tables referred to in one of the programs to refer to the same tables as the other, and possibly hacking the registration details script to add a requirement for the relevant fields requiers for both programs. Obviously this assumes that the appropriate fields for such would be merged into that table. Could it work, or does this acctually sound like more trouble than it's worth, or more difficult than I possibly realise?
 
If you are running more than one app, I would recommend using a seperate database for each, but use the same mysql instance.

If you are on a UNIX system, I could help you write a shell script to backup the mysql databases into files, which you could place in a cron job.

Sorry, I know that doesn't really answer your question, it was just some more help I could think of.
 
Since your programs are open source then you can rewrite them in any way you like. It is all about your skills with PHP and SQL..
 
Very good point Nodsu, and Thanks Phant :)

I'm afraid my skills are minimal or less at the moment. I'm on a fairly steep learning curve with this.

It's the first time I've set up a server on my machine for testing, and I've managed to get apache working, installed PHP4, I've installed a MySQL server, and added phpMyAdmin.

I do have one or two issues I'm working through, but I have two problems I can't understand.

First, in phpMyAdmin, I get the following alerts...
The $cfg['PmaAbsoluteUri'] directive MUST be set in your configuration file!

The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.

I understand niether of these, particularly as I've read advice to the contrary of the first alert!

Secondly, after installing OsCommerce, I was flicking through the administration options, and spotted the only problem I've found so far, being on the customers --> orders section....

Customers Order Total Date Purchased Status Action
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit -20, 20

[TEP STOP]

Given that I have so little knowledge of MySQL, I can't tell whether this is a bug in the software, a problem with my PHP install (the least likely option I feel) or otherwise a problem with my MySQL server/version or the way I've configured it.
 
It should be $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin-2.6.1-pl3' in order to work.
Otherwise set $cfg['PmaAbsoluteUri_DisableWarning'] = TRUE; to disable the warnings.

Do a Google with "limit -20, 20" (and you MUST use the double quotes!).
Plenty help already in the first 2 Google results.
 
Status
Not open for further replies.
Back