Gizmo99
11-14-2009, 04:58 PM
Ok
Simple thing I have a Form that people can put membership numbers into, then a script will check in Mysql if they are or not
Then print out Yes or No and expiry if Yes
Works fine for single lookup but make it do more lookup ie 8 the output templete just shows last lookup in the list result.
if you just print the out ot the screen all the 8 results are there
Help
foreach ( $_POST as $name => $value) {
if ((stristr($name,'membership')) && ($value !=0 ) ) {
// Check to See if Member
$check_if_member=$db->query_first("SELECT MemberID, DateExpire FROM ~~~~~ WHERE MemberID = $value");
if ($check_if_member){
$membership_number=$value;
$Expire_Date=$check_if_member['DateExpire'];
}
else
{
$membership_number=$value;
$Expire_Date="" ;
}
print_r ($check_if_member) ;
echo "<br /> $name, $value <br />" ;
}
eval('print_output("'. fetch_template('rsoc_member_check_output') . '");');
Screen output
membership_number2, 1
membership_number3, 2
membership_number4, 3
membership_number5, 2
membership_number6, 34
Array ( [MemberID] => 14**** [DateExpire] => *******)
membership_number8, 14****
What do i need to either do in the script or template to output the above ?
* = protect data
Giz
Simple thing I have a Form that people can put membership numbers into, then a script will check in Mysql if they are or not
Then print out Yes or No and expiry if Yes
Works fine for single lookup but make it do more lookup ie 8 the output templete just shows last lookup in the list result.
if you just print the out ot the screen all the 8 results are there
Help
foreach ( $_POST as $name => $value) {
if ((stristr($name,'membership')) && ($value !=0 ) ) {
// Check to See if Member
$check_if_member=$db->query_first("SELECT MemberID, DateExpire FROM ~~~~~ WHERE MemberID = $value");
if ($check_if_member){
$membership_number=$value;
$Expire_Date=$check_if_member['DateExpire'];
}
else
{
$membership_number=$value;
$Expire_Date="" ;
}
print_r ($check_if_member) ;
echo "<br /> $name, $value <br />" ;
}
eval('print_output("'. fetch_template('rsoc_member_check_output') . '");');
Screen output
membership_number2, 1
membership_number3, 2
membership_number4, 3
membership_number5, 2
membership_number6, 34
Array ( [MemberID] => 14**** [DateExpire] => *******)
membership_number8, 14****
What do i need to either do in the script or template to output the above ?
* = protect data
Giz