Greetings, all! I'm new to PHP and am using 100 Web Space as a platform to educate myself along with "PHP & MySQL for Dummies". I've managed to get a few test scripts to run in PHP, small successes, but now I've entered the database testing code (found below) and get the error: "Fatal error: Call to undefined function: mysqli_connect() in /home/www/jesarr.100webspace.net/dbtest.php on line 12" which has me nonplussed. I created a MySQL database via the control panel in my account menu, named it and created a password, so it's there. I also tried setting the $host variable equal to "localhost" but that didn't help. My current assumption is that I'm entering an invalid host address, but I'm new, so I'm not too sure. If that isn't the correct host address, btw, can anyone tell me what I ought to be entering? Thanks for your responses, although I know C++ (which is very similar to PHP) a lot of this MySQL stuff is rough.
Code:
<?php
echo "<html>
<head>
<title>Test MySQL</title>
</head>
<body>";
$host="mysql1.100ws.com";
$user="user";
$password="password";
$cxn = mysqli_connect($host,$user,$password);
$sql="SHOW STATUS";
$result = mysqli_query($cxn,$sql);
if($result == false)
{
echo "<h4>Error: ".mysqli_error($cxn)."</h4>";
}
else
{
/*Table that displays the results*/
echo "<table border='1'>
<tr><th>Variable_name</th>
<th>Value</th></tr>";
for($i = 0; $i < mysqli_num_rows($result); $i++)
{
echo "<tr>";
$row_array = mysqli_fetch_row($result);
for ($j = 0; $j < mysqli_num_fields($result); $j++)
{
echo "<td>".$row_array[$j]."</td>\n";
}
}
echo "</table>";
}
?>
</body></html>