Read Multiple Records

function getAllMatches($composite_IN) {
/*
Get all kds_associate records which have a composite field value of
$composite. Assign them to $allMatches.
*/
  global $allMatches;
  if (!get_magic_quotes_gpc()) {
    $composite_IN = addslashes($composite_IN);
  }
  $query = "SELECT id, nextPhrase, isComplete
            FROM kds_associate
            WHERE composite='$composite_IN'";
  $result = mysql_query($query);
  if (!$result) {
    die('Query failed. Err: 68398994. -Programmer.');
  }
  $allMatches = array();
  while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $allMatches[] = $row;
  }
  return;
}
Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Coding, Database and tagged , , . Bookmark the permalink.