mysql_fetch_array(): supplied argument is not a valid MySQL result resource solved

    To solve the problem of mysql_fetch_array(): supplied argument is not a valid MySQL result resource You can use query like this no resource error then
    <?php

    $count_query
    = @mysql_query("select pid from portfolio where category=". $cid);
    $pids = array();
    if (
    $count_query) {
      while (
    $count_result = @mysql_fetch_array($count_query)) {
       
    $pids[] = $count_result['pid'];
      }
    }
    ?>
    5
    Average: 5 (1 vote)