View Full Version : MySQL 4.1
Hi!
Please, have Pixelpost support for MySQL 4.1 or only MySQL 4.0? I use MySQL 4.1 and Pixelpost doesn't work. :((
BTW, I can't speak English... This is only example of English. ;-)
Connie
04-14-2005, 01:39 PM
Well, MySQL 4.1 should work, I have no other information
what is not working?
can you connect to the database?
can you upload images?
are thumbnails created?
is the first page empty after uploading images?
please give more correct information, we will try to understand
good luck, Connie
what is not working?
can you connect to the database?
can you upload images?
are thumbnails created?
is the first page empty after uploading images?
ad 1) system haven't got a mysqli functions ... MySQL 4.1 use different functions.
MySQL 3.23, 4.0 : mysql_select_db(parametrs...)
MySQL 4.1 : mysqli_select db(parametrs, different list parametrs)
ad 2,3,4) no, system doesn't work
I recommended database layer. Example:
$VersionDatabase = 2; // MySQL 4.0 = 1 || MySQL 4.1 = 2
if($VersionDatabase == 1) {
function sql_connect(parameters..) {
return mysql_select_db(parameters...);
}
}
else {
function sql_connect(parameters..) {
return mysqli_select_db(parameters...);
}
}
I try add like DB layer, but fail it. :(
raminia
04-14-2005, 03:19 PM
change mysql_select_db functions
inside admin/install.php and admin/upgradefrom14beta.php to
mysqli_select db
I don't think that is the problem with MYSQL 4.1. That is actually your PHP version that makes things strange. I think you use "PHP 5 CVS". mysql_select_db () should work in php version 3/4/5 but mysqli_select_db() is only available in PHP 5 CVS.
Pixelpost is running right now on MYSQL version 4.1 with a PHP vesrion 4.3.11 in our demo
http://www.blinking8s.com/temp/dev/pixelpost/v1.4/admin/index.php?view=info
login with user/pass : admin/admin. Everything's OK!
raminia
04-14-2005, 03:34 PM
I made changes to make it compatible to MYSQL version 4.1 and 5.x
I don't have those versions here. try it and tell me
http://www.raminia.com/temp/pixelpost_1.4.zip
I made changes to make it compatible to MYSQL version 4.1 and 5.x
I don't have those versions here. try it and tell me
http://www.raminia.com/temp/pixelpost_1.4.zip
Don't work. :( Call to undefined function mysql_ ...
raminia
04-14-2005, 03:52 PM
at which line?
where was the error? tell me complete!
raminia
04-14-2005, 04:08 PM
do you have PHP 5 ?
I think so! I changed the file I provided before. download it again and tell me what happend.
changed function
function start_mysql()
{
global $pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass, $pixelpost_db_pixelpost;
mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error());
$mysql_version = mysql_get_server_info();
if ((substr($mysql_version,0,3)=="4.1" || substr($mysql_version,0,2)=="5.")& substr(phpversion(),0,1)=="5")
{
// MYSQL 4.1.x OR 5.x
mysqli_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
else
{ // MYSQL 4.0.x
mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
}
raminia
04-14-2005, 04:18 PM
if it did not work again use
function start_mysql()
{
global $pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass, $pixelpost_db_pixelpost;
mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error());
$mysql_version = mysql_get_server_info();
if (substr($mysql_version,0,3)=="4.1" || substr($mysql_version,0,2)=="5.")
{
// MYSQL 4.1.x OR 5.x
mysqli_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
else
{ // MYSQL 4.0.x
mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
}
and if it did not work again check your php and mysql versions again. the function mysql_select_db is supported in PHP 3,4,5 but mysqli_select_db is only supported in PHP 5 CVS !!
Like raminia said: problem is with PHP5 not with MySQL.
Some time ago (near half a year) I was fighting with PHP5 and MySQL 4.1x and I lost :/
Maybe try to add to your http server info that *.php should be handled by PHP4, not PHP5?
I've got next idea - maybe we should use ADODB interface to DB?? I could make PP DB server independent (if we add correct SQL for the most popular of them).
at which line?
where was the error? tell me complete!
Fatal error: Call to undefined function mysql_connect() in C:\dev\www\pixelpost2\includes\functions.php on line 162
And I've got Apache 2.0.49, PHP 5 and MySQL 4.1 ... With MySQL 4.0 system work. :-)
I've got next idea - maybe we should use ADODB interface to DB?? I could make PP DB server independent (if we add correct SQL for the most popular of them).
Yeah, it's good idea.
do you have PHP 5 ?
I think so! I changed the file I provided before. download it again and tell me what happend.
changed function
function start_mysql()
{
global $pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass, $pixelpost_db_pixelpost;
mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error());
$mysql_version = mysql_get_server_info();
if ((substr($mysql_version,0,3)=="4.1" || substr($mysql_version,0,2)=="5.")& substr(phpversion(),0,1)=="5")
{
// MYSQL 4.1.x OR 5.x
mysqli_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
else
{ // MYSQL 4.0.x
mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error());
}
}
and functions mysql_connect, mysql_error and 10 other functions... :(
and functions mysql_connect, mysql_error and 10 other functions... :(
And that is a reason why ADODB would be the bast solution ;)
raminia
04-14-2005, 05:18 PM
errors in function call could be a reason to change the DB?
I'dont agree.
report your PHP version plz!
I think you have don something wrong or have not supported unstable versions of PHP or Mysql!
Raminia, you have probably already read this, but...
In PHP 5, MySQL is no longer enabled by default, nor is the MySQL library bundled with PHP. Read this FAQ for details on why.
Note: Windows users will need to enable php_mysql.dll inside of php.ini and either copy libmysql.dll into the Windows system directory, or make it available to the PATH.
This will fix "Unable to load dynamic library './php_mysql.dll'" errors.
For compiling, simply use --with-mysql=[DIR] where [DIR] points to your MySQL installation directory.
This MySQL extension doesn't support full functionality of MySQL versions greater than 4.1.0. For that, use MySQLi.
If you would like to install the mysql extension along with the mysqli extension you have to use the same client library to avoid any conflicts.
Note, it is not just the connect functions, but all of the functions for the MySQL extension that are not supported. In order to support this, I think we need to wrap all of our queries.
What we need is adodb, or our own database class to wrap this...
As for this person, I think all we can say for now is unsupported. If he can though, he can probably enable the MySQL extension and get it to work, especially if he is on a windows box.
Anonymous
04-14-2005, 06:03 PM
no I didn't noticed this. Just when I was installing my MYSQL 4 on local machine. I underestand and agree now.
Ramin
(Raminia not logged in)
raminia
04-14-2005, 08:02 PM
wordpress currently uses mysql and php and there is a big challenge there for supporting other databases
Read this:
http://codex.wordpress.org/Using_Alternative_Databases
maybe we should use ezsql too : http://php.justinvincent.com/home/articles.php?articleId=2
BTW, hosting services usually support the MYSQL and PHP requirements. Is it a big deal?
IMHO ADODB is much more powerful and better coz:
- is used by more big PHP & SQL based aplication such as: ACID, PostNuke, Xaraya, phpWiki, Mambo, PHP GACL, TikiWiki, eGroupWare and phpLens App Server
- what is more importent, support more DBs (http://phplens.com/adodb/supported.databases.html)
http://adodb.sourceforge.net/
PS We should use ANSI SQL (& as I looked to SQL code there is more or less as simply and clear as ANSI SQL). This can give us 100% support for all DBs with one common SQL code (only DB creation code can look not the same) :)
errors in function call could be a reason to change the DB?
I'dont agree.
report your PHP version plz!
PHP 5.0.3 ;-)
I think you have don something wrong or have not supported unstable versions of PHP or Mysql!
Yeah, but i've got MySQL 4.1.10a-nt on WinXP... IMHO it's official version. ;)
raminia
04-15-2005, 12:00 PM
enable MYSQL for your windows nt as commando has mentioned and it will be ok.
enable MYSQL for your windows nt as commando has mentioned and it will be ok.Edit your php.ini file, find the section with the various extensions and uncomment the mysql extension. Save the file and restart apache.
Sorry, I don't have PHP on my work machine, so i can't give you the exact line.
raminia
04-15-2005, 01:14 PM
enable MYSQL for your windows nt as commando has mentioned and it will be ok.Edit your php.ini file, find the section with the various extensions and uncomment the mysql extension. Save the file and restart apache.
Sorry, I don't have PHP on my work machine, so i can't give you the exact line.
php.ini should be somewhere like c:\windows
php.ini should be somewhere like c:\windows
More or less near line 550.
php.ini can also be in your PATH_TO_PHP_DIRECTORY\php.ini. In c:\WINDIR, c:\WINDIR\System or c:\WINDIR\System32 can be only when is in CGI mode.
Edit your php.ini file, find the section with the various extensions and uncomment the mysql extension. Save the file and restart apache.
Thank you, very much! :)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.