I'm making a form in drupal and want to check if an email already exists in my database.
db_insert('CASL_SUBBED')
->fields(array(
'email' => $form_state['values']['email'],//email
'ip' => $ip55,//ip
'substatus' => $subbed,
'datetime' => $sDate,//date and time
That's my code for inserting into the database, but I want to see if the email already exists before I insert this into it. Is there anyway to do this? Thanks.