Hi,
I'm totally new to php, and I've installed apache friends. Everything works fine, except the following:
connect.php:
$server = "localhost";
$gebruiker = "root";
$wachtwoord = "";
$db = "test";
$connectie = mysql_connect($server,$gebruiker,$wachtwoord)
or die ("Kon niet connecteren met de server");
mysql_select_db($db,$connectie)
or die ("Kon de database niet selecteren");
firstconnect.php:
<html>
<head>
<title>my first php connection </title>
</head>
<body>
<?php
include "connect.php";
$query = "SELECT * FROM `producten` WHERE `prijs` > '2' ";
$sql = mysql_query($query)or die ( mysql_error( ) );
while($record = mysql_fetch_object($sql)){
echo"".$record->naam."<br>";
}
?>
</body>
</html>
The error I get:
...No database selected
I use the default "test" database on the mysql server. I've put a table "producten" in it.
I hope my explanation is clear.
Thanks.