List:General Discussion« Previous MessageNext Message »
From:Aaron Ford Date:December 6 2004 6:13pm
Subject:Newbie, MySQL test fails, spent hours, please help
View as plain text  
Hey.

The code that I'm trying to get to work is as follows.  The problem is
with the 7th, 8th, and 9th lines...

<html>
<head>
<title>Test MySQL</title>
<body>
<!-- mysql_up.php -->
<?php
$host="";
$user="";
$password=" ";

mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if ($result == 0)
   echo("<b>Error " . mysql_errno() . ": " . mysql_error() . "</b>");
elseif (mysql_num_rows($result) == 0)
   echo("<b>Query executed successfully!</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>

The server that I'm uploading to is www.allbutnothing.com.  I know my
computer name, is the correct form for the host value
computername.webserver.com??  How do I find my username and password,
the only one I entered was the one when MySQLadmin.exe installed...  is
that the username and password that should be used?

Thanks very much.


Thread
Newbie, MySQL test fails, spent hours, please helpAaron Ford6 Dec
  • Re: Newbie, MySQL test fails, spent hours, please helpEric Bergen6 Dec