 |
Apache2Triad Help, Support and Development The apache2triad help , support and development forums
|
| View previous topic :: View next topic |
| Author |
Message |
krtek80
Joined: 18 Apr 2009
Posts: 1
|
| Posted: Mon Apr 20, 2009 3:29 pm Post subject: some php scripts not working |
|
|
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. |
|
| Back to top |
|
mamun05
Joined: 09 Nov 2009
Posts: 1
|
| Posted: Mon Nov 09, 2009 4:17 am Post subject: Script not working on ONE server... but works on 2 others! |
|
|
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 |
|
| Back to top |
|
| |
|