MySQL Wildcard

[email protected] (Karl DeSaulniers)
Newsgroups php.db
Message-ID <[email protected]>
Hello All,
What I want to do is get all the fields from a table without  
specifying which ID to grab from.
I am trying to implement a wildcard in my query. What am I doing  
wrong? I keep getting...

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

CODE:::::

function getOptGrps($ID){
       if ($ID == "All") {
          $ID = "%"; // % = MySQL multi character wildcard
       }
       $q = "SELECT * FROM ".OPT_GRPS_TABLE." WHERE OptGrpID LIKE  
'$ID' ";
       $result = $this->query($q);
       /* Error occurred, return given name by default */
       if(!$result || (mysql_numrows($result) < 1)){
          return NULL;
       }
       /* Return result array */
       $array_results = mysql_fetch_array($result);
       return $array_results;
    }

AND this does not work either

function getOptGrps(){
       $q = "SELECT * FROM ".OPT_GRPS_TABLE;
       $result = $this->query($q);
       /* Error occurred, return given name by default */
       if(!$result || (mysql_numrows($result) < 1)){
          return NULL;
       }
       /* Return result array */
       $array_results = mysql_fetch_array($result);
       return $array_results;
    }

TIA,

Karl DeSaulniers
Design Drumm
http://designdrumm.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.