Jump to content


Photo

MySQL Query Error


  • Please log in to reply
3 replies to this topic

#1 balkan7

balkan7
  • Members
  • PipPipPip
  • Advanced Member
  • 234 posts

Posted 28 October 2006 - 01:26 PM

Warning: Wrong parameter count for mysql_query()

$query = mysql_query ($dbname,"select * from top_cats order by catname",$db) or die (mysql_error());


#2 gmwebs

gmwebs
  • Members
  • PipPipPip
  • Advanced Member
  • 174 posts
  • LocationLondon

Posted 28 October 2006 - 01:51 PM

You are not using it correctly. Refer to the documentation on how to correctly use it.

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 October 2006 - 01:53 PM

Mysql query only has two parameters. Your code code has three parameters. The only parameters mysql_query has is the query and the secound parameter which is optional is the link identify to the mysql connection. So this is what the line should look like:
$query = mysql_query ("select * from top_cats order by catname") or die (mysql_error());


#4 balkan7

balkan7
  • Members
  • PipPipPip
  • Advanced Member
  • 234 posts

Posted 28 October 2006 - 01:58 PM

thank you, i was try whit include datebase but show me error, i fix now, thanks again.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users