Program working well in localhost,but not in the internet!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

GM
Forum Contributor
Posts: 365
Joined: Wed Apr 26, 2006 4:19 am
Location: Italy

Post 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?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

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

Post 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!
manikandan
Forum Newbie
Posts: 10
Joined: Sat Oct 07, 2006 1:43 am

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
manikandan
Forum Newbie
Posts: 10
Joined: Sat Oct 07, 2006 1:43 am

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
manikandan
Forum Newbie
Posts: 10
Joined: Sat Oct 07, 2006 1:43 am

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
manikandan
Forum Newbie
Posts: 10
Joined: Sat Oct 07, 2006 1:43 am

Post 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
Post Reply