Kestrad Posted January 7, 2010 Share Posted January 7, 2010 I'm creating a php class, but I receive the following error: Wrong parameter count for mysql_fetch_assoc(). It tells me that the problem is in the constructor, which is as follows: function __construct($arg1 = 0){ $q = mysql_fetch_assoc('getQuoteById', $arg1); $this->quote = $q['quote']; } getQuoteById is a sql query: SELECT id, quote FROM quote WHERE id=%d where id and quote are the two columns in the table quote. Could someone please explain to me what this error means? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/187525-what-does-this-error-mean/ Share on other sites More sharing options...
Maq Posted January 7, 2010 Share Posted January 7, 2010 That function takes a single parameter, a resource. You're giving it a string and $arg. Read more here: http://us.php.net/mysql_fetch_assoc Try to fix it, if you need more help post back. Quote Link to comment https://forums.phpfreaks.com/topic/187525-what-does-this-error-mean/#findComment-990117 Share on other sites More sharing options...
Kestrad Posted January 7, 2010 Author Share Posted January 7, 2010 Okay, I understand! Thanks for clearing that up. Quote Link to comment https://forums.phpfreaks.com/topic/187525-what-does-this-error-mean/#findComment-990120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.