|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PEAR DB::connect to MySQL 5
I maintain an existing PHP/MySQL web application that uses PEAR DB.
PHP 4.3.11 MySQL 3.23.58 The owners of this application have decided to move the database to another machine and have installed MySQL 5.0.21. I cannot get my existing code to connect to this machine. I can connect to the MySQL 5 db via the mysql command line from the host where Apache and PHP reside. I have also been able to connect with PHP's mysql_connect command. I now see that there are mysql and mysqli PHP types. I also saw a note that leads me to believe that you must use mysqli for MySQL 4.1 and above databases? Is that the case (and the source of my problem)? Also it appears that mysqli only works with PHP5? Thanks -- Brad |
|
#2
|
||||
|
||||
|
RE: PEAR DB::connect to MySQL 5
the php4 and mysql5 work together with the mysql_* calls (since you are already connecting with the mysql_connect() - you've proved that). What mysqli and pdo provide is full usage of mysql's new features. the mysql_* was never menat to handle the newer features of MySQL. If you have no plans to use the new features - you should be fine.
Reference: http://dev.mysql.com/doc/refman/4.1/en/php-problems.html |
|
#3
|
|||
|
|||
|
RE: PEAR DB::connect to MySQL 5
I might have same kind of a problem. Using PEAR:
I have a old computer that has PHP 4.4.0 and mysql 4.1.14, now I'm asked to transfer it to mysql 5.0.18. The new computer has PHP 4.4.4 installed. I'm able to connect to the database, but it seems that the querys give no result. Although I'm able to login to my system (login username and password coming from the db), nothing else seems to be going/coming through. I have no idea what to do next. Please help? |
|
#4
|
||||
|
||||
|
RE: PEAR DB::connect to MySQL 5
All the old code should work fine on the new MySQL version. Best I can say is that on the queries that aren't running to use mysql_error() find out what is wrong.
|
|
#5
|
|||
|
|||
|
RE: PEAR DB::connect to MySQL 5
I put to simpleQuery on DB/mysql.php and found out that MySQL was offended by the syntax of the querys.
It all lead to some querys having "..from table1 a, table2 b left join table3 c on (a.somecol = c.someothercol) where ..." and just switching places for table1 and table2 corrected it. Old MySQL had accepted them. Luckily I didn't make those queries. All fixed now. Thank you. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > PEAR DB::connect to MySQL 5 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|