wamp server not working? or bad php code

Posted by lclaud on Stack Overflow See other posts from Stack Overflow or by lclaud
Published on 2010-06-15T13:24:10Z Indexed on 2010/06/15 13:32 UTC
Read the original article Hit count: 315

Filed under:

I have this PHP code:

<?php
        $username="root";
        $password="******";// censored out
        $database="bazadedate";
        mysql_connect("127.0.0.1",$username,$password); // i get unknown constant localhost if used instead of the loopback ip 
        @mysql_select_db($database) or die( "Unable to select database");
        $query="SELECT * FROM backup";
        $result=mysql_query($query);
        $num=mysql_numrows($result);

        $i=0;
        $raspuns="";
          while ($i < $num) {
            $data=mysql_result($result,$i,"data");
            $suma=mysql_result($result,$i,"suma");
            $cv=mysql_result($result,$i,"cv");
            $det=mysql_result($result,$i,"detaliu");

            $raspuns = $raspuns."#".$data."#".$suma."#".$cv."#".$det."@";

          $i++;
          }

             echo "<b> $raspuns </b>";

        mysql_close();
?>

And it should return a single string containing all data from the table. But it says "connection reset when loading page".

the log is :

[Tue Jun 15 16:20:31 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue Jun 15 16:20:31 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Jun 15 16:20:31 2010] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jun 15 16:20:31 2010] [notice] Parent: Created child process 2336
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Child process is running
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Acquired the start mutex.
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Starting 64 worker threads.
[Tue Jun 15 16:20:31 2010] [notice] Child 2336: Starting thread to listen on port 80.
[Tue Jun 15 16:20:35 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Tue Jun 15 16:20:35 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Tue Jun 15 16:20:35 2010] [notice] Server built: Dec 10 2008 00:10:06
[Tue Jun 15 16:20:35 2010] [notice] Parent: Created child process 1928
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Child process is running
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Acquired the start mutex.
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Starting 64 worker threads.
[Tue Jun 15 16:20:35 2010] [notice] Child 1928: Starting thread to listen on port 80.

Any idea why it outputs nothing?

© Stack Overflow or respective owner

Related posts about php