php mysql db connect error
i have been using this piece of code in sothink dhtml menue 


    <?

    $dbhost = "localhost"; // DB Host name
    $dbusername = "root"; // DB User
    $dbpass = ""; // DB User password
    $dbname = "menue"; // DB Name
    $query = "select * from Category";
    $connection = mysql_connect($dbhost, $dbusername, $dbpass);
    $resultCat = mysql_query($dbname, $query);
    $numrowsCat = mysql_num_rows($resultCat);

    for ($i = 0; $i < $numrowsCat; $i++)
    {
    $rowCat = mysql_fetch_array($resultCat);
    $CatName = $rowCat["Name"];

    ?>

And getting the following errors

mysql_query() expects parameter 2 to be resource, on line

    $resultCat = mysql_query($dbname, $query); 
and mysql_num_rows() expects parameter 1 to be resource, null given in on line 
    
    mysql_num_rows() expects parameter 1 to be resource, null given in

Thanks


php mysql db connect error
===

i have been using this piece of code in sothink dhtml menue 


    <?

    $dbhost = "localhost"; // DB Host name
    $dbusername = "root"; // DB User
    $dbpass = ""; // DB User password
    $dbname = "menue"; // DB Name
    $query = "select * from Category";
    $connection = mysql_connect($dbhost, $dbusername, $dbpass);
    $resultCat = mysql_query($dbname, $query);
    $numrowsCat = mysql_num_rows($resultCat);

    for ($i = 0; $i < $numrowsCat; $i++)
    {
    $rowCat = mysql_fetch_array($resultCat);
    $CatName = $rowCat["Name"];

    ?>

And getting the following errors

mysql_query() expects parameter 2 to be resource, on line

    $resultCat = mysql_query($dbname, $query); 
and mysql_num_rows() expects parameter 1 to be resource, null given in on line 
    
    mysql_num_rows() expects parameter 1 to be resource, null given in

Thanks

