I have a form where i want to submit two entries. Its the entry_id and email. I have a php function that begins something like this:
public function theFunction($data) {
if (false && !empty($data['email']) && !empty($data['entry_id']) ) {
$sql = $this->db->select()
->from('votes')
->where('entry_id = ?', $data['entry_id'])
->where('email = ?', $data['email'])
->order('created DESC');
But how am i supposed to call this function from a php file and bringing the values from the form with me, this is far as i've come but it doesent seem to work:
$fields = array("email","entry_id");
$data = array();
foreach($fields as $field){
$data[$field] = $_POST[$field];
}
echo theFunction($data);
Does anyone know how i should do?
if(false && ...)will always returnfalseand the sql will never be executed.