Skip navigation links

MySQL Forums :: PHP :: mysql_fetch_assoc(): supplied argument is not a valid MySQL error


Advanced Search

mysql_fetch_assoc(): supplied argument is not a valid MySQL error
Posted by: niek h ()
Date: March 11, 2013 01:38PM

hallo,

if i try do run the code below i get this error: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in ....
What could I to do make my code work?
Thanks for all your effort already :).


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">;

<html>
<head>
<title>Voorbeeld 9.4 - De resultaten naar het scherm schrijven met mysql_fetch_row()</title>
<?php
$server = "localhost"; // naam van de MySQL-databaseserver
$user = "root"; // inlognaam
$wachtwoord = "usbw"; //wachtwoord voor dit account
$database = "ict"; // naam van de database die we gebruiken
$query = mysql_query("SELECT 'naam_toneelstuk','Gerne' FROM 'table 2' WHERE 'Gerne' = 'toneel'"); // de SQL-query die wordt uitgevoerd


while ($row = mysql_fetch_assoc ($query) ) {

echo $row['gerne'];

echo $row['naam_toneelstuk'];
}


?>
</head>

<body>


</body>
</html>


niek

Options: ReplyQuote


Subject Written By Posted
mysql_fetch_assoc(): supplied argument is not a valid MySQL error niek h 03/11/2013 01:38PM
Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL error Peter Brawley 03/11/2013 02:07PM
Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL error Barry Galbraith 03/11/2013 09:33PM
Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL error niek h 03/12/2013 08:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.