On Sat, 8 Jun 2002 11:58:25 +0200, "Søren" <sorenh@gmx.net> wrote:
><?php
>//connect to the database
>$conn = mysql_connect("localhost", "xbase", "secret")
> or die ("Couldn' connect to server");
>$selected = mysql_select_db("xbase", $conn)
> or die ("Couldn't connect to database");
>
>//Query the database
>$sql = "SELECT titel FROM bog";
>$result = mysql_query ($sql, $conn);
>if ($result) {
> $titel = mysql_result ($result, 0, 'titel');
> echo("The title of the first book is $titel.");
>} else {
> echo("Query failed: $sql");
Smid en:
echo mysql_error();
ind her. Så ser du den fejl som mysql giver, i stedet for bare en
intetsigende "Query failed".
>}
>mysql_close($conn);
>?>
--
Mads Lie Jensen - mads@gartneriet.dk - ICQ #25478403
http://www.gartneriet.dk
Directory Opus - nu også til windows -
http://www.gpsoft.com.au