I'm not exactly sure what is going on here, but I've set up a test gallery on my site using the latest 1.0.1 beta, and i'm still getting the same issues i was haveing with 1.0 beta. I know nothing about mysql (except the basics to get a database setup).
My test gallery is found at www.cjsimmons.net/testzp/ and there is an error message at the top that reads:
MySQL Error: Could not select the database
I have set up everything correctly as per instruction, but keep seeing this error, and currently i have another error on the screen saying:
MySQL Query ( SELECT *, (date + 0) AS date FROM albums WHERE `folder`='Sky-Clouds' LIMIT 1; ) Failed. Error: No database selected
Does anyone know what is going on here? Any help would be greatly appreciated. My main gallery is still running 0.9 beta, and I'm keen to upgrade to that latest.
thanks in advance.
Comments
Could not select the database $db
which should translate as Could not select the database DATABASENAME
If I go into my config.php and remove my DB name... the same thing happens on my test install.
ensure that you have this line of code in your config.php
$conf['mysql_database'] = "{DATABASENAME}";
and obviously disregard this if you have already checked this but I have hacked my config.php in many different ways to see if I could recreate that error and this was the only way.
What happens if you do an upgrade from .9 to 1.0.. does it see the db then?
Does this error happen during setup or does setup complete fine?
What webhost is it... (server type, php version, mysql version).?
Paste your config.php in the forum.. (removing the password obviously.
Upgrading has the exact same result as a fresh install.
Setup completes, and everything looks fine. I can use admin with no problems at all. It sees the database and I can edit photos and the like.
Webhost is my own. Win2K3 server, running XAMPP. PHP 5.0.5, MySQL 5.0.15.
Below is a copy of my config.php as requested. I removed the username and password and replaced them with "xxxx".
<?php /* PUT NOTHING BEFORE THIS LINE, not even a line break! */
$conf = array();
define("DEBUG", false);
/** Do not edit above this line. **/
/**********************************/
/////////// zenPHOTO Configuration Variables //////////////////////////////
// After you're done editing this file, load
// http://www.yoursite.com/zenphotodir/zen/setup.php
// to run the setup (of course, replacing the paths where needed).
// NOTE: web_path and server_path are no longer needed! :-)
// Database login information (the most important part).
$conf['mysql_user'] = "xxxx";
$conf['mysql_pass'] = "xxxx";
$conf['mysql_host'] = "localhost"; // Probably won't need to change this.
$conf['mysql_database'] = "zptest";
// If you're sharing the database with other tables, use a prefix to be safe.
$conf['mysql_prefix'] = "zp_";
// What you want to call your photo gallery.
$conf['gallery_title'] = "my photos";
// If you're in a different time zone from your server, set the offset in hours:
$conf['time_offset'] = 0;
// Tags allowed in comments
$conf['allowed_tags'] = "<i><b>
";
// If you have Apache mod_rewrite, put true here, and you'll get nice cruft-free URLs.
// MAKE SURE TO EDIT THE .htaccess FILE with your path information.
$conf['mod_rewrite'] = true;
// Admin interface username (also required for running setup).
$conf['adminuser'] = "admin";
// Obviously insecure, don't put anything here you don't want anyone to see...
// but make sure you change it to something other than 1234...
$conf['adminpass'] = "1234";
// The email for the admin user. Used to send notification emails.
$conf['admin_email'] = "xxx@xxx.xxx";
// Image Processing Configuration
// Maximum size in Megabytes of the cache folder (where processed images are stored).
// After this is hit, a cleanup function will run and delete some least recently used resized images.
$conf['maxcache'] = 100;
// JPEG Compression quality for all images and thumbnails (respectively):
$conf['image_quality'] = 85;
$conf['thumb_quality'] = 75;
// Default image display width (themes will be able to control this
// to an extent in the future, but for now you may have to adjust it to fit your theme).
$conf['image_size'] = 595;
// If this is set to true, then the longest side of the image will be $image_size.
// Otherwise, the *width* of the image will be $image_size.
$conf['image_use_longest_side'] = true;
// Default thumbnail size and scale:
// If $thumb_crop is set to true, then the thumbnail will be a centered portion of the image
// with the given width and height after being resized to $thumb_size (by shortest side).
// Otherwise, it will be the full image resized to $thumb_size (by shortest side).
// NOTE: thumb_crop_width and height should always be less than or equal to thumb_size
$conf['thumb_crop'] = true;
$conf['thumb_crop_width'] = 85;
$conf['thumb_crop_height'] = 85;
$conf['thumb_size'] = 100;
// Paging options.
// Control of their display is done in the theme, so you might need to change these
// after switching themes to make it look better.
$conf['albums_per_page'] = 10;
$conf['images_per_page'] = 15;
/** Do not edit below this line. **/
/**********************************/
$_zp_conf_vars = $conf;
?>
Everything looks right to me.
Looks like you will need to get a confirmation from luckyspin or trisweb, and see what they have to say.
EDIT: I downloaded and installed xampp and it did not work for me either.. i get the same errors you get. Admin panel works.. everything seems normal until I try to go to the album.. setup completes fine.. I even did an upgrade and same thing.
xampp, php5, mysql 5
After that didnt work.. i connected it to my msql4 server and it worked fine.. so it looks like it is a mysql5 problem.. apparently functions-db.php contains new code that is not compatible with mysql5.
Here's the link:
https://developer.berlios.de/projects/zenphoto/
https://developer.berlios.de/bugs/?func=detailbug&bug_id=6108&group_id=4265
You are correct about functions-db.php, I replaced that file with the copy from 0.9 and had the same error.
I tested with the newest xampp and it breaks no matter what I do. I eventually had to grab the newest version that still used mysql4.
i got an email from luckyspin about this, but he hasn't yet responded.
http://www.zenphoto.org/support/topic.php?id=276