Re: Newbie Setup Trouble

From: Date: Mon, 07 Feb 2005 15:34:31 +0000
Subject: Re: Newbie Setup Trouble
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38489@lists.php.net to get a copy of this message
The code appears to be correct. But it sounds like a problem with the php/mysql integration. Try reinstalling PHP with the correct mysql libraries. In phpinfo check that mysql support is enabled. If you are not technical and would just like to learn the PHP language not how to configure it etc. I would recommend you use a PHP software installation package (it basically installs everything for you). I think this installation kit supports windoze + Linux:- http://www.apachefriends.org/en/xampp.html Hope that helps, Gareth On 7 Feb 2005, at 14:55, php-db-digest-help@lists.php.net wrote:
<html> <head><title>Test MySQL</title></head> <body> <!-- mysql_up.php --> <?php $host="localhost"; $user="blablablabla"; $password="blablabla"; mysql_connect($host,$user,$password); $sql="show status"; $result = mysql_query($sql); if ($result == 0) { echo "<b>Error " . mysql_errno() . ": "
         . mysql_error() . "</b>";
} else { ?> <!-- Table that displays the results --> <table border="1"> <tr><td><b>Variable_name</b></td><td><b>Value</b>
      </td></tr>
<?php
    for ($i = 0; $i < mysql_num_rows($result); $i++) {
      echo "<TR>";
      $row_array = mysql_fetch_row($result);
      for ($j = 0; $j < mysql_num_fields($result); $j++)
      {
        echo "<TD>" . $row_array[$j] . "</td>";
      }
      echo "</tr>";
    }
?> </table> <?php } ?> </body></html>


« previous php.db (#38489) next »