Welcome Guest, Not a member yet? Register   Sign In
Custom Form Validation with Database
#11

[eluser]davidMC1982[/eluser]
You have a blank page because there's a syntax error in your code. You have no closing } for the booking_check() function.
#12

[eluser]terrycyleung[/eluser]
Hi,
I added "}" to custom function and it still blank page.... I don't know why? >_<
Thank you so much.

#13

[eluser]davidMC1982[/eluser]
Because you still have errors in your code somewhere.
#14

[eluser]terrycyleung[/eluser]
Hi Master,
I guest the error is in this new custom function, when I enable this check the "blank page" will show and this appointment must cannot insert to database either is it have duplicate record, could you please help me to check, thank you so much.

I also modify this function, is it the error exist in foreach? I don't know is it retrieved the record and store in array.

function booking_check($appointment_date, $start_time, $end_time)
{
$result = True;
$appointment_date = $this->input->post('appointment_date');
$start_time = $this->input->post('start_time');
$end_time = $this->input->post('end_time');
$query = get_appointments($appointment_date);
//$query = $this->appointment_model->get_appointments($appointment_date);

foreach ($query as $appointment){
if (strtotime($start_time) == strtotime($appointment['start_time']))
{
$this->form_validation->set_message('booking_check', '%s Time Deuplicate');
return FALSE;
$result = FALSE;
} //End if
} //End foreach
} //End of booking Check

#15

[eluser]TheFuzzy0ne[/eluser]
[quote author="TheFuzzy0ne" date="1363438197"]A blank page is normally caused by outputting a space or tab after a PHP closing tag. You can safely omit closing tags at the end of a file, and it helps prevent this kind of thing. Also, be sure that you have error reporting enabled. At the top of your index.php file, add the following:

Code:
ini_set('display_errors', '1');
error_reporting(E_ALL);

Once we have fixed the problem, we can move on from there.[/quote]




Theme © iAndrew 2016 - Forum software by © MyBB