Hello:
I already installed the amazing software created by this amazing group.
All is function very nice, but the problem is I want to run a basic example of query a database.
I see the database using Navicat Software. Also I see the Cd's database that come in the examples after the complete installation.
After I run this: http://localhost/example.6-1.php
Using this code from a example of the book: written by Hugh E. Williams & David Lane (PHP and My SQL)
For now I use the root only. But I will change it soon.
Also the database winestore only has one user the "root"
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Wines</title>
</head>
<body>
<pre>
<?php
// (1) Open the database connection
$connection = mysqli_connect("localhost","root","");
// (2) Select the winestore database
mysqli_select_db("winestore", $connection);
// (3) Run the query on the winestore through the connection
$result = mysqli_query ("SELECT * FROM
wine", $connection);
// (4) While there are still rows in the result set, fetch the current
// row into the array $row
while ($row = mysqli_fetch_array($result, MYSQL_NUM))
{
// (5) Print out each element in $row, that is, print the values of
// the attributes
foreach ($row as $attribute)
print "{$attribute} ";
// Print a carriage return to neaten the output
print "\n";
}
?>
</pre>
</body>
</html>
This is the response of the webpage.
Warning: mysqli_select_db() expects parameter 1 to be mysql, string given in C:\Program Files\xampp\htdocs\example.6-1.php on line 16
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\Program Files\xampp\htdocs\example.6-1.php on line
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\Program Files\xampp\htdocs\example.6-1