0

Hello, I have a problem with this script when i will check it in the browser, the output is :
"Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\doto\php\new_case.php on line 8
FOUT
SELECT * FROM disp_type ORDER BY t_naam ASC
Resource id #3"

<?php
 $host="localhost";
$username="TEST";
$password ="";
$dbnaam="DOTO";
 
 $db=mysql_connect($host, $username, $password) or die (mysql_error());
 mysql_select_db($dbnaam, $db) or die (mysql_error());

 $query_test = "SELECT * FROM disp_type ORDER BY t_naam ASC";
 if(!$result = mysql_query($db,$query_test))
 {
	 echo('FOUT<br>');
	 echo($query_test . '<br>');
	 echo($db);
	 exit;
 }
 while($record = mysql_fetch_array($result))
 {
	 echo "ID : {$record['t_id']}<br>Naam: {$record['t_naam']}<br>";
 }
 ?>

As you can see, echo($db) = Recource ID #3 ??
Can you please help me?

3
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by ariese
0

You should write like this.

if(!$result = mysql_query($query_test,$db))

Edited by ariese: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.