View Full Version : Multiple Galleries-same DB
jonmarsh
18th of March 2003 (Tue), 03:59
Hello Pekka
I have a requirement to create several galleries, however my site host only allows one MySQL database per domain (Never more than one, I cannot buy another as the MySQL database is free and the host will not step outside of his standard packages).
What I therefore need is to be able to set up different galleries 'in the same database'.......
Is there any likelyhood of you allowing such a configuration parameter (such as table prefix string) which would allow me to segregate data from different galleries within the same database.
Best regards
Jon Marshall
Pekka
18th of March 2003 (Tue), 09:16
jonmarsh wrote:
What I therefore need is to be able to set up different galleries 'in the same database'.......
Is there any likelyhood of you allowing such a configuration parameter (such as table prefix string) which would allow me to segregate data from different galleries within the same database.
Hi,
What you ask can be done but it could take a lot of work to do it. Main reason is that EE uses a lot of mysql result arrays which should be converted to $prefix + "rest_of_tablename".
e.g. code
$ftp_name = $fdata["ee_ftp_name"];
$ftp_server = $fdata["ee_ftp_server"];
$ftp_user_name = $fdata["ee_ftp_username"];
$ftp_user_pass = $fdata["ee_ftp_password"];
would become
$prefix = "ee_";
$ftp_name = $fdata[$prefix . "ftp_name"];
$ftp_server = $fdata[$prefix . "ftp_server"];
$ftp_user_name = $fdata[$prefix . "ftp_username"];
$ftp_user_pass = $fdata[$prefix . "ftp_password"];
or, mysql query
SELECT
ee_order_to_exhibition.ee_photo_id,
ee_order_to_exhibition.ee_exhibition_id,
ee_order_to_exhibition.ee_order,
ee_photo.ee_photo_header,
ee_photo.ee_photo_filename,
ee_order_to_exhibition.ee_order_to_exhibition_id
FROM
ee_photo,
ee_order_to_exhibition
WHERE
ee_order_to_exhibition.ee_exhibition_id = '$exhibition'
AND ee_photo.ee_photo_id = ee_order_to_exhibition.ee_photo_id
ORDER BY
ee_order_to_exhibition.ee_order $ascdesc
would become
SELECT
{$prefix}order_to_exhibition.{$prefix}photo_id,
{$prefix}order_to_exhibition.{$prefix}exhibition_i d,
{$prefix}order_to_exhibition.{$prefix}order,
{$prefix}photo.{$prefix}photo_header,
{$prefix}photo.{$prefix}photo_filename,
{$prefix}order_to_exhibition.{$prefix}order_to_exh ibition_id
FROM
{$prefix}photo,
{$prefix}order_to_exhibition
WHERE
{$prefix}order_to_exhibition.{$prefix}exhibition_i d = '$exhibition'
AND {$prefix}photo.{$prefix}photo_id = {$prefix}order_to_exhibition.{$prefix}photo_id
ORDER BY
{$prefix}order_to_exhibition.{$prefix}order $ascdesc
I could be perhaps done with a simple search and replace, but my experience is that you may in the end have to do it mostly by hand to ensure no new bugs are introduced.
jonmarsh
19th of March 2003 (Wed), 04:57
Yeah,
but this would cause too much re-work for new versions.......
thanks anyway,
br
Jon
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.