On delete Cascade in php

## ON Delete Cascade: Cascade will work when you delete something on table Courses. Any record on table BookCourses that has reference to table Courses will also be deleted. But when you try to delete on table BookCourses only the table itself is affected and not on the Courses follow-up question: why do you have … Read moreOn delete Cascade in php

Get email not send errors

How can I get the error message for the mail() function? You can use error_get_last()when mail() returns false. $success = mail(‘[email protected]’, ‘My Subject’, $message); if (!$success) { $errorMessage = error_get_last()[‘message’]; } With print_r(error_get_last()), you get something like this: [type] => 2 [message] => mail(): Failed to connect to mailserver at “x.x.x.x” port 25, verify your … Read moreGet email not send errors

Email Validation check in javascript

## Used To Validate Email In Javascript <script >   function validateEmail(email) {     var emailReg = /^([\w-\.][email protected]([\w-]+\.)+[\w-]{2,4})?$/;     return emailReg.test( email );   } </script>

Generating child categories

// For Generating Array Parent & Child Wise $this->dash_model->cattest(0)); public function cattest($parent_id) { $sqlquery = ” SELECT * FROM categories where parent='” .$parent_id . “‘ “; $row = $this->db->query($sqlquery)->result_array(); $allCategory = array(); if(count($row)>0){ foreach ($row as $value){ $tempCat    = array(); $cat_id     = $value[‘id’]; $tempCat[‘categoty_details’] = $value; //has sub category $hasSubCat = $this->cattest($cat_id); … Read moreGenerating child categories