Я создал базу данных для списка добровольцев. Затем форма для извлечения личной информации для добровольцев, которые подписались добровольцем для конкретных задач. Я новичок в php, и я искал ответ и пробовал несколько способов сделать это, но, увы, не повезло.
Вот критический код, с которым я сейчас борюсь:
if(isset($_POST['planning']) && $_POST['planning'] == '1')
{ $result1 = mysql_query("SELECT * FROM volunteers WHERE planning = '1'");}
if(isset($_POST['signatures']) && $_POST['signatures'] == '1')
{ $result2 = mysql_query("SELECT * FROM volunteers WHERE signatures = '1'");
$newresult1 = array_merge($result1, $result2);}
if(isset($_POST['canvassing']) && $_POST['canvassing'] == '1')
{ $result3 = mysql_query("SELECT * FROM volunteers WHERE canvassing = '1'");
$newresult2 = array_merge($newresult1, $result3);}
if(isset($_POST['phone_bank']) && $_POST['phone_bank'] == '1')
{ $result4 = mysql_query("SELECT * FROM volunteers WHERE phone_bank = '1'");
$newresult3 = array_merge($newresult2, $result4);}
if(isset($_POST['media']) && $_POST['media'] == '1')
{ $result5 = mysql_query("SELECT * FROM volunteers WHERE media = '1'"); $newresult4 =
array_merge($newresult3, $result5);}
if(isset($_POST['press_releases']) && $_POST['press_releases'] == '1')
{ $result6 = mysql_query("SELECT * FROM volunteers WHERE press_releases = '1'");
$newresult5 = array_merge($newresult4, $result6);}
if(isset($_POST['volunteer_coordinator']) && $_POST['volunteer_coordinator'] == '1')
{ $result7 = mysql_query("SELECT * FROM volunteers WHERE volunteer_coordinator =
'1'");
$newresult6 = array_merge($newresult5, $result7);}
if(isset($_POST['speaker']) && $_POST['speaker'] == '1')
{ $result8 = mysql_query("SELECT * FROM volunteers WHERE speaker = '1'"); $newresult7
= array_merge($newresult6, $result8);}
if(isset($_POST['house_parties']) && $_POST['house_parties'] == '1')
{ $result9 = mysql_query("SELECT * FROM volunteers WHERE house_parties = '1'");
$newresult8 = array_merge($newresult7, $result9);}
if(isset($_POST['web_page']) && $_POST['web_page'] == '1')
{ $result10 = mysql_query("SELECT * FROM volunteers WHERE web_page = '1'");
$newresult9
= array_merge($newresult8, $result10);}
if(isset($_POST['other']) && $_POST['other'] == '1')
{ $result11 = mysql_query("SELECT * FROM volunteers WHERE other = '1'"); $newresult10
= array_merge($newresult9, $result11);}
$newresult10 = array_unique($newresult10);
while($row = mysql_fetch_array($newresult10)) {
echo $row['first_name'] . " " . $row['last_name'];
echo " ";
echo $row['email'];
echo " ";
echo $row['phone'];
echo "<br />";
Я очень ценю любые предложения.