I did a search for the following error I received:
Warning: Wrong parameter count for mysql_query() in /export/www/... on line 83

The code on line 83 is very simple:

$query= mysql_query("SELECT * FROM request2") or die(mysql_error());

Since the syntax seems correct, I assume something is wrong with my table, nonetheless, another thread suggested adding this:

$run = mysql_query($query) or die(mysql_query());

Result: Same error.

My table looks like this:
id | int(11) | | | 0 | |
| rarea | varchar(5) | | | | |
| rspecs | varchar(50) | | | | |
| farea | varchar(5) | | | | |
| fspecs | varchar(50) | | | | |
| fmem | varchar(5) | | | | |
| fmspecs | varchar(50) | | | | |
| sarea | varchar(5) | | | | |
| sspecs | varchar(50) | | | | |
| parea | varchar(5) | | | | |
| pspecs | varchar(50) | | | | |
| session_id | int(11) | | PRI | NULL | auto_increment |

I've tried adding a unique key and obviously a primary auto_incrementing key, what else might be causing this error? Is there any way to get a more specific error message? Any suggestions would be appreciated, thanks.

    that is a PHP error not a mySQL error. very strange considering that second argument, the resource link_identifier, is optional but you might trying passing it anyway. read the manual page for [man]mysql_query[/man] for the exact syntax.

      of course you allready have a connection and db chosen? maybe pass the resource link to the mysql_query() function? it is optional though.

        Thanks for the response.
        I was able to resolve this error by moving the link identifier (as you suggested) to the main page, initially it was a function in an include page that I would reference.

        $connect = mysql_connect('localhost', 'uname', 'pw') or die(mysql_error());
        

        but now I get another error which doesn't seem to make much sense, because I've done this on other pages numerous times without problems.
        Error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

        $query = mysql_query("SELECT * FROM request2", $connect);
        while ($row = mysql_fetch_array($query))	{
        if ($row['id'] == $id)	{
             ...
        }
        }
        

        Simple query. Any idea why it won't work in this case?

        Regarding the link identifier, placing it on a separate/include page has worked in other instances. It's confusing why/when you need to add the link identifier to the same page.

        Thanks.

          what does [man]mysql_error[/man] have to say?

            while ($row = mysql_fetch_array($query) or die(mysql_query()))	{
            

            Error:
            Warning: Wrong parameter count for mysql_query() in /export/www/labs/test/ind_db2/ind_request/ind_db4.php on line 85

            Go figure...

              $query = mysql_query('SELECT * FROM request2', $connect) or exit(mysql_error());
              while ($row = mysql_fetch_array($query))
              { 
              	print_r($row);
              }
              

                I accidentally inserted mysql_query instead of mysql_error. The rror revealed that when I moved the connection code over to the main page I negleted to include the db select code. Thanks for the help.

                  Write a Reply...