Ridiculously complex search Form
Can someone please help me figure out what I did wrong in this code? I'm trying to type a first and last name into the 2 search boxes and then have it output the results that match $ServingQuery. Right now nothing happens though.
<?php require_once('Connections/local_i.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php
$UserFirstName = new WA_MySQLi_RS("UserFirstName",$local_i,0);
$UserFirstName->setQuery("SELECT pcms2_users.UserID, pcms2_users.UserFirstName FROM pcms2_users");
$UserFirstName->execute();
?>
<?php
$UserLastName = new WA_MySQLi_RS("UserLastName",$local_i,0);
$UserLastName->setQuery("SELECT pcms2_users.UserID, pcms2_users.UserLastName FROM pcms2_users");
$UserLastName->execute();
?>
<?php
$ServingQuery = new WA_MySQLi_RS("ServingQuery",$local_i,1);
$ServingQuery->setQuery("SELECT pcms2_users.UserID, pcms2_users.UserFirstName, pcms2_users.UserLastName, kids_program_shifts.kp_team_id, kids_program_shifts.kp_volunteer, cleaning_team_shifts.cleaning_team_id, cleaning_team_shifts.ct_volunteer, serving_team.* FROM pcms2_users INNER JOIN kids_program_shifts ON pcms2_users.UserID = kids_program_shifts.kp_volunteer INNER JOIN cleaning_team_shifts ON pcms2_users.UserID = cleaning_team_shifts.ct_volunteer INNER JOIN serving_team ON cleaning_team_shifts.cleaning_team_id = serving_team.id AND kids_program_shifts.kp_team_id = serving_team.id");
$ServingQuery->execute();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<form method="get">
<input type="search" name="UserFirstName" id="UserFirstName">
<input type="search" name="UserLastName" id="UserLastName">
<input type="submit" name="search" value="search">
<?php
while(!$ServingQuery->atEnd()) {
?>
<?php echo($ServingQuery->getColumnVal("UserFirstName")); ?>
<?php echo($ServingQuery->getColumnVal("UserLastName")); ?>
<?php echo($ServingQuery->getColumnVal("team")); ?>
<?php
$ServingQuery->moveNext();
}
$ServingQuery->moveFirst(); //return RS to first record
?>
</form>
</body>
</html>