Page 2 of 2

Posted: Wed Oct 11, 2006 8:15 am
by GM
Your localhost is running PHP 5.xx and your server is running PHP 4.xx - have you changed your scripts to include some PHP 5 only functions?

Re: Program working well in localhost,but not in the interne

Posted: Wed Oct 11, 2006 10:08 am
by RobertGonzalez
manikandan wrote:After modifying i upload that file into web server. That modified page alone not working well, i mean that page displays HTML content alone,it didn't fetch the data from DataBase.
From a PHP5 Local server to a PHP4 Production server with different extensions loaded...

Ok, post your database connection code (without your database login credentials please) so I can see something in it. PLEASE DO NOT POST YOUR MYSQL USERNAME OR PASSWORD!

Posted: Thu Oct 12, 2006 5:14 am
by manikandan
Dear Mr Volka & Everah ,
Thanks a lot. I have found the problem using Mr.Volka's error handling code.

Code: Select all

$db = mysql_connect(,,) or die(mysql_error()) 
mysql_select_db(,$db) or die(mysql_error()); 

$query = '...'; 
$result = mysql_query($query, $db) or die (mysql_error()); 

if ( 0==mysql_num_rows($result) ) { 
        echo 'no results'; 
}
and

Code: Select all

$result = mysql_query($query, $db) or die (mysql_error()); 
echo "\n<div>Debug: ", mysql_num_rows($result), " records found.</div>\n";
This error handlig code reports that the server side mysql version cannot process the complex query like this(below the complex query),

Code: Select all

$sql="(Select c_colori.cod_parte as code,c_colori.descr_parte FROM c_colori INNER JOIN ordini2 ON (c_colori.cod_parte=ordini2.cod_art AND ordini2.bu='".$name."') )UNION (select c_colori.cod_parte,c_colori.descr_parte FROM c_colori INNER JOIN ordini3 ON (c_colori.cod_parte=ordini3.cod_art AND ordini3.bu='".$name."')) UNION  (select c_colori.cod_parte,c_colori.descr_parte FROM c_colori INNER JOIN magazzino_transito_1 ON (c_colori.cod_parte=magazzino_transito_1.cod_art AND magazzino_transito_1.bu='".$name."') )order by code;";
I would like to say thanks to Dev forum network and all the peoples who all are contributory and help me to come out from this problem.
Once again Thanks to Mr.Volka & Mr.Everah,
Thanks and Regards,
Manikandan S,
Mumbai-India.

Posted: Thu Oct 12, 2006 7:27 am
by volka
manikandan wrote:This error handlig code reports that the server side mysql version cannot process the complex query like this(below the complex query),

Code: Select all

$sql="(Select c_colori.cod_parte as code,c_colori.descr_parte FROM c_colori INNER JOIN ordini2 ON (c_colori.cod_parte=ordini2.cod_art AND ordini2.bu='".$name."') )UNION (select c_colori.cod_parte,c_colori.descr_parte FROM c_colori INNER JOIN ordini3 ON (c_colori.cod_parte=ordini3.cod_art AND ordini3.bu='".$name."')) UNION  (select c_colori.cod_parte,c_colori.descr_parte FROM c_colori INNER JOIN magazzino_transito_1 ON (c_colori.cod_parte=magazzino_transito_1.cod_art AND magazzino_transito_1.bu='".$name."') )order by code;";
hm weird. complex yes but "cutting edge mysql technology"?
what mysql version do you use on your server?
In case of doubt

Code: Select all

<?php
$db = mysql_connect('localhost', '...username...', '...password...') or die(mysql_error());
echo  'server version: ', mysql_get_server_info($db);
?>
will tell.

Posted: Fri Oct 13, 2006 3:15 am
by manikandan
Dear Mr.Volka,
Thanks for your commitment again.

MySQL Version:
Server:
MySQL 3.23.54
phpMyAdmin 2.6.1-rc1
Localhost:
MySQL - 5.0.24a
phpMyAdmin - 2.8.2.4


Thanks and Regards,
Manikandan

Posted: Fri Oct 13, 2006 5:24 am
by volka
manikandan wrote:MySQL Version:
Server:
MySQL 3.23.54
UNION wasn't implemented in mysql 3.
3.23.54 was released ~4 years ago
http://dev.mysql.com/doc/refman/4.1/en/news.html wrote:D.3.6. Changes in release 3.23.54 (05 December 2002)
and is not up-to-date for quite a while.
Also note
http://downloads.mysql.com/archives.php?p=mysql-3.23&v=3.23.54 wrote:MySQL is discontinuing support of this release on 31 July 2006 according to our support lifecycle policy announcement. MySQL Network subscribers and OEM customers will continue to be supported until 31 Dec 2006.

Posted: Fri Oct 13, 2006 7:34 am
by manikandan
Dear Mr.Volka,

I really gets lot of the information from you. And i have visited the URL you mentioned. I would like to say thanks for your valuable commitment with me. Thanks a lot. Please tell me wheather i continued with that MySQL server 3.23.54 or else i have to change my version?

Thanks & Regards,
Manikandan

Posted: Fri Oct 13, 2006 10:15 am
by RobertGonzalez
Change your version. At the very least move to 4.1. 5.0 is the most stable release at the moment (I believe, though it could be 5.1). But at the very least, get to 4.1.

Posted: Sat Oct 14, 2006 1:28 am
by manikandan
Dear Mr.Everah,
Thanks for your kind valuable suggestion. I forwarded your suggestion to my superior. I'm waiting for his reply.
Thanks again !
Thanks & Regards,
Manikandan S