php 5 upgrade

php 5 upgrade

am 08.07.2007 04:31:07 von nicholas

hi,

before I get started with my problem would like to say thanks to all
the people who keep newsgroups going.

I am running WAMP and recently upgrading (after solving a few problems
getting the rigth php 5.dll file for apache 2.0 )

I upgraded because of the improved functionality such as the ability
to write to arrays using the foreach construct as an example. However
there are very few free information resources for these specific
updgrade problems.

Amongst the few errors I have encountered as a result of the upgrade:

1/ Error reporting. At first the my code stop working due to the error
reporting as a result of php 5 E_ALL in php.ini
After some research found that I could solve this problem by adding
the line: error_reporting(0); to the files where these errors were
being displayed. I am slightly uncomfortable with this solution.

2/I have started getting errors to the tune of undefined col 'xxx' in
mysql statements using left joins which previously worked ok. After
some research the only possible solution I could come to was that the
syntax for left join statements had been changed under mysql 5(mainly
on website for users updgrading from a earlier version of mysql)
however I have not upgraded mysql

3/Call to undefined function mysql_connect has started appearing for
some reason. Having restructured mysql statements with left joins to
the 'correct syntax' (see 2) I get this unusual error. Has my database
dissolved into the ether?

Its difficult trying to plug the particular error when there are
several stop gap measures already implemented. The lack of information
on the php 5 upgrade is a problem. if anyone knows of any good faqs or
has encountered similar problems would be great to hear from you.

Re: php 5 upgrade

am 08.07.2007 10:51:52 von Paul Lautman

Nicholas wrote:
> hi,
>
> before I get started with my problem would like to say thanks to all
> the people who keep newsgroups going.
>
> I am running WAMP and recently upgrading (after solving a few problems
> getting the rigth php 5.dll file for apache 2.0 )
>
> I upgraded because of the improved functionality such as the ability
> to write to arrays using the foreach construct as an example. However
> there are very few free information resources for these specific
> updgrade problems.
>
> Amongst the few errors I have encountered as a result of the upgrade:
>
> 1/ Error reporting. At first the my code stop working due to the error
> reporting as a result of php 5 E_ALL in php.ini
> After some research found that I could solve this problem by adding
> the line: error_reporting(0); to the files where these errors were
> being displayed. I am slightly uncomfortable with this solution.
>
> 2/I have started getting errors to the tune of undefined col 'xxx' in
> mysql statements using left joins which previously worked ok. After
> some research the only possible solution I could come to was that the
> syntax for left join statements had been changed under mysql 5(mainly
> on website for users updgrading from a earlier version of mysql)
> however I have not upgraded mysql
>
> 3/Call to undefined function mysql_connect has started appearing for
> some reason. Having restructured mysql statements with left joins to
> the 'correct syntax' (see 2) I get this unusual error. Has my database
> dissolved into the ether?
>
> Its difficult trying to plug the particular error when there are
> several stop gap measures already implemented. The lack of information
> on the php 5 upgrade is a problem. if anyone knows of any good faqs or
> has encountered similar problems would be great to hear from you.

You are confusing lots of things here.
1/ Error reporting. E_ALL in php.ini is nothing to do with php 5 per se. The
particular installation of php 5 that you have chosen (the WAMP package),
happens to come with that setting for error reporting. If you prefer
different setting in php.ini, then change it. the WAMP package has an easy
way to access the config files from its task bar icon.

2/ This is nothing to do with php. This is to do with mysql. The details of
how mysql 5 more closely followed the later SQL specifications for "comma"
joins is well documented and was discussed a lot when the new version was
issued. You need to re-write your queries for MySQL 5 compatibility. They
will also end up more readable. As a stopgap, if you really want to, putting
brackets around the tables listed with the comma joins usually cures this.
But I would strongly advise re-writing the queries using the JOIN keywords
which makes the intentions much clearer for maintenance (which I see you
have done).

3/ I can't explain this one I'm afraid. I have no such problem with my WAMP
installation.

Re: php 5 upgrade

am 08.07.2007 11:02:05 von Shion

Nicholas wrote:

> 3/Call to undefined function mysql_connect has started appearing for
> some reason. Having restructured mysql statements with left joins to
> the 'correct syntax' (see 2) I get this unusual error. Has my database
> dissolved into the ether?

If you get "undefined function mysql_connect" and you are sure you have the
mysql extension properly configured and that the dll is installed in the right
place, then your hard drive is getting close to it's end, I suggest you make a
backup of all important data and install new hard drive on which you install a
fresh OS and get your data from the backup you made.

This can be a good time to emigrate to a system that is more proper for server
use, you can do like microsoft and use BSD or do as quite many others and use
Linux.


--

//Aho

Re: php 5 upgrade

am 10.07.2007 08:41:31 von nicholas

thanks.

it was that I had commented the mysql dll from the ini.

I know this may be a mysql question but was hoping someone might know
what was what.

As previously mentioned am running Apache service and php 5 binaries
in Windows w/ mysql 5

my queries were working fine under mysql 5 until I upgraded to php 5
which is why I suspect it may be due to this although I was previously
unware of the left join and comma syntax which I have rewritten.

I receive an error Unknown column 'feature' in 'where clause'

which I first suspected was mysql 5 left join syntax

the line it refers to is located below.. but (this is interesting)
when I change the column name from feature to another column in the
table the query works.

//page voronoi.php
include connect.php //connection to database

function Voronoi($featureType){
/*Search for the feature based on name
returns an array of point coordinates (x,y)
*/
$featureCoordinates = array();
$counter=0;
$query = "select * from features where feature LIKE '".
$featureType."'";

which is included in the index page

incidentally the query which uses the left join is below. I call this
page using javascript via ajax http_request which does the job fine
but when I include the file(below) I get the error above?

include "perth_special.php" //database connect

function search(&$tree, $table, $word){
//RECURSIVE SEARCH:-for each matching synset retrieve its 'derived'
word, store in an array and repeat procedure on resulting word.
$query = "select t.synset_id_2, s.word from (wn_synset AS s, $table
AS t) LEFT JOIN $table t ON (s.synset_id = t.synset_id_1) where
s.synset_id='".$word."' and s.ss_type='n'";

so I am trying to isolate the problem..

thanks in advance Nicholas

Re: php 5 upgrade

am 10.07.2007 10:46:35 von Captain Paralytic

On 10 Jul, 07:41, Nicholas wrote:
> thanks.
>
> it was that I had commented the mysql dll from the ini.
>
> I know this may be a mysql question but was hoping someone might know
> what was what.
>
> As previously mentioned am running Apache service and php 5 binaries
> in Windows w/ mysql 5
>
> my queries were working fine under mysql 5 until I upgraded to php 5
> which is why I suspect it may be due to this although I was previously
> unware of the left join and comma syntax which I have rewritten.
>
> I receive an error Unknown column 'feature' in 'where clause'
>
> which I first suspected was mysql 5 left join syntax
>
> the line it refers to is located below.. but (this is interesting)
> when I change the column name from feature to another column in the
> table the query works.
>
> //page voronoi.php
> include connect.php //connection to database
>
> function Voronoi($featureType){
> /*Search for the feature based on name
> returns an array of point coordinates (x,y)
> */
> $featureCoordinates = array();
> $counter=0;
> $query = "select * from features where feature LIKE '".
> $featureType."'";
>
> which is included in the index page
>
> incidentally the query which uses the left join is below. I call this
> page using javascript via ajax http_request which does the job fine
> but when I include the file(below) I get the error above?
>
> include "perth_special.php" //database connect
>
> function search(&$tree, $table, $word){
> //RECURSIVE SEARCH:-for each matching synset retrieve its 'derived'
> word, store in an array and repeat procedure on resulting word.
> $query = "select t.synset_id_2, s.word from (wn_synset AS s, $table
> AS t) LEFT JOIN $table t ON (s.synset_id = t.synset_id_1) where
> s.synset_id='".$word."' and s.ss_type='n'";
>
> so I am trying to isolate the problem..
>
> thanks in advance Nicholas

Can you post a dump of the table schema (the CREATE TABLE command that
comes out of PMA would be great.

Re: php 5 upgrade

am 12.07.2007 10:54:50 von nicholas

sure. appreciate the effort

Enter password: *********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 36 to server version: 5.0.24a-community-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use perth_special;
Database changed
mysql> show tables;
+-------------------------+
| Tables_in_perth_special |
+-------------------------+
| features |
+-------------------------+
1 row in set (0.11 sec)

mysql> desc features;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| feature | varchar(99) | YES | | NULL | |
| name | varchar(255) | NO | | | |
| longitude | float | NO | | | |
| latitude | float | NO | | | |
+-----------+--------------+------+-----+---------+-------+
4 rows in set (0.05 sec)

Re: php 5 upgrade

am 12.07.2007 11:38:07 von Captain Paralytic

On 12 Jul, 09:54, Nicholas wrote:
> sure. appreciate the effort
>
> Enter password: *********
> Welcome to the MySQL monitor. Commands end with ; or \g.
> Your MySQL connection id is 36 to server version: 5.0.24a-community-nt
>
> Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
>
> mysql> use perth_special;
> Database changed
> mysql> show tables;
> +-------------------------+
> | Tables_in_perth_special |
> +-------------------------+
> | features |
> +-------------------------+
> 1 row in set (0.11 sec)
>
> mysql> desc features;
> +-----------+--------------+------+-----+---------+-------+
> | Field | Type | Null | Key | Default | Extra |
> +-----------+--------------+------+-----+---------+-------+
> | feature | varchar(99) | YES | | NULL | |
> | name | varchar(255) | NO | | | |
> | longitude | float | NO | | | |
> | latitude | float | NO | | | |
> +-----------+--------------+------+-----+---------+-------+
> 4 rows in set (0.05 sec)

Please try again!

I said:
"Can you post a dump of the table schema (the CREATE TABLE command
that
comes out of PMA would be great."

You sent the output from "show tables".

Please post what I asked for, and ensure that you have the option for
"Enclose table and field names with backquotes" ticked.

Re: php 5 upgrade

am 14.07.2007 05:10:03 von nicholas

PMA - phpMyAdmin?

Re: php 5 upgrade

am 14.07.2007 10:10:04 von nicholas

I installed pma and found that my database conection script was
reading from an old table which I had created and not deleted. So now
I know what the problem is.

Thanks