Can't check if more than 1 post data isset in the same if statement <p>I'm trying to validate data but I'm having trouble. </p> <p>The problem is I am checking if certain post data is set. Problem is it's either always set or not, i think it's because I am trying to check for multiple things in an incorrect format in my if statement? </p> <p>I think it's only this line that is incorrect but I am having some sort of mental block.</p> <p>I understand it is probably something quite trivial but I can't think of a way to word it to find a solution via Google.</p> <pre><code>if ((!isset($_POST['first_name'])) || (!isset($_POST['contact_no'])) || (!isset($_POST['device'])) || (!isset($_POST['fault']))) { echo 'no Name, contact number, device or fault given.'; } </code></pre> <p>I know i could check in separate if's but I would really like to refresh how i check multiple items in the same statement..</p> <p>After trying suggestions, without any luck, adding more information:</p> <pre><code>if (isset($_POST['posted']) == 'TRUE') { $error = array(); if( !isset($_POST['first_name']) ){ $error[] = 'no Name given.'; } elseif( !isset($_POST['contact_no']) ){ $error[] = 'no contact number given.'; } elseif( !isset($_POST['device']) ) { $error[] = 'no Device given.'; } elseif( !isset($_POST['fault']) ) { $error[] = 'no fault given.'; } if( count($error)!==0){ echo 'Error(s) occured:&lt;br /&gt;'.implode('&lt;br /&gt;', $errors); } else { $db-&gt;query("INSERT INTO repairs (r_oem, r_device, r_mod, r_reserve, r_price, r_s_date, r_e_date, r_notes, rc_fname, rc_lname, rc_email, rc_contactno, rc_return, rc_status, rc_status_2, rc_status_txt, rc_status_txt_2, booked_by, passcode) VALUES( '$make', '$device', '$model', '$fault', '$price', '$date', '$date2', '$notes', '$fname', '$lname', '$email', '$cno', '','$status', '', '', '', '$bookedby', '$pass')"); $get_id = $db-&gt;query("SELECT LAST_INSERT_ID()"); $print_id = $db-&gt;fetch_row($get_id); $last_r_id_insterted = $db-&gt;query("SELECT * FROM `repairs` ORDER BY `repairs`.`r_id` DESC LIMIT 1"); $plrid = $db-&gt;fetch_row($last_r_id_insterted); echo '&lt;br /&gt;'; echo &lt;&lt;&lt;EOF &lt;script&gt; alert("Successfully created record for {$fname} {$lname}\'s {$make} {$device} {$model}. Job Reference: {$plrid['r_id']}"); &lt;/script&gt; EOF; print "&lt;span style='float: left; margin-left:25px;'&gt;&lt;a class='button positive' 'href=\"print_label.php?ref={$plrid['r_id']}\" target=\"_blank\"&gt;Printable Sticky Label.&lt;/a&gt;&lt;/span&gt;&lt;span class='fright'&gt;&lt;a class='button positive' href=\"print_card.php?ref={$plrid['r_id']}\" target=\"_blank\"&gt;Printable Customer Card.&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;"; if (isset($_POST['item1'])) { $db-&gt;query("UPDATE repairs SET part1id={$_POST['item1']} WHERE r_id={$plrid['r_id']}"); $db-&gt;query("UPDATE stock SET commited=commited+1, s_count=s_count-1 WHERE id={$_POST['item1']}"); } if (isset($_POST['item2'])) { $db-&gt;query("UPDATE repairs SET part2id={$_POST['item2']} WHERE r_id={$plrid['r_id']}"); $db-&gt;query("UPDATE stock SET commited=commited+1, s_count=s_count-1 WHERE id={$_POST['item2']}"); } if (isset($_POST['item3'])) { $db-&gt;query("UPDATE repairs SET part3id={$_POST['item3']} WHERE r_id={$plrid['r_id']}"); $db-&gt;query("UPDATE stock SET commited=commited+1, s_count=s_count-1 WHERE id={$_POST['item3']}"); } if (isset($_POST['item4'])) { $db-&gt;query("UPDATE repairs SET part4id={$_POST['item4']} WHERE r_id={$plrid['r_id']}"); $db-&gt;query("UPDATE stock SET commited=commited+1, s_count=s_count-1 WHERE id={$_POST['item4']}"); } if (isset($_POST['item5'])) { $db-&gt;query("UPDATE repairs SET part5id={$_POST['item5']} WHERE r_id={$plrid['r_id']}"); $db-&gt;query("UPDATE stock SET commited=commited+1, s_count=s_count-1 WHERE id={$_POST['item5']}"); } else { print "No Parts Selected&lt;br /&gt;"; } } } </code></pre>