Re: Newbie Setup Trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx 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>

-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux