Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 some php scripts not working
Google
Post new topic Reply to topic
Author Message
krtek80
 
 


Joined: 18 Apr 2009
Posts: 1

PostPosted: Mon Apr 20, 2009 3:29 pm Reply with quoteBack to top

Hello, I have a problem with functionality of some PHP scripts - for example function mysql_list_dbs works well and generates list of databases, however mysql_fetch_object or mysql_result do not work - generate only blank website.

THIS SCRIPT WORKS - GENERATES LIST OF MYSQL DATABASES
<?php
$spojeni = mysql_connect('localhost');
$seznam_databazi = mysql_list_dbs($spojeni);

while ($radek = mysql_fetch_object($seznam_databazi)) {
echo $radek->Database. "\n";
}
?>

THIS SCRIPT GENERATES ONLY THE SAME NUMBER OF DASH SIGNS IDENTICAL TO NUMBER OF ROWS IN THE TABLE, BUT DOES NOT GENERATE THE CONTENT OF ROWS
<?php
mysql_connect("localhost");
mysql_select_db("test");
$vysledek = mysql_query("SELECT * FROM filmy");
while ($radek = mysql_fetch_object($vysledek))
{
echo $radek->nazev;
echo " - ";
echo $radek->rok;
echo "<br />";
}
mysql_free_result($vysledek);
?>

THIS SCRIPT GENERATES BLANK WEBSITE

<?php
mysql_connect("localhost");
mysql_select_db("test");
$vysledek = mysql_query("SELECT cislo, nazev, rok FROM filmy ");
echo mysql_result($vysledek, 0,"nazev");
?>
ANYONE HAVING A CLUE WHY?
MYSQL VERSION 5.018-NT-LOG - WEBSERVER APACHE2TRIAD, OPERATION WINDOWS
thanks a lot.
View user's profileSend private message
mamun05
 
 


Joined: 09 Nov 2009
Posts: 1

PostPosted: Mon Nov 09, 2009 4:17 am Reply with quoteBack to top

I have used Zoom on my development website (which runs PHP 4.1.2), and everything runs smoothly. But then, when I copy my script to my production website (which runs PHP 4.3.2), the script seems to timeout. After 1 second, all I get is the standard "The page cannot be displayed" error from Internet Explorer. I don't even get a search form!

I have made some tests to rule out possibilities: file attributes are OK, file name is right, and my other scripts (in the same folder) are running correctly.

I suspect this might be caused by a server limitation. Is it possible that my web hosting company limits the script size, number of lines or complexity? When I strip down the "search.php" script to about 974 lines, it displays the form correctly; no timeout or error whatsoever! But as soon as I add the next big loop (after the "Count number of output lines that match ALL search terms" comment), I get the "page not found" error. The server chokes!

It's strange because there is absolutely no outpout returned by the script; that's why I think it's the server choking on the code while compiling PHP, and not the execution!

I have no idea on how to debug/correct this, and I don't even know how to explain it to the hosting company. This is so absurd.
Reply With Quote
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT