count entries in database where bla = something and ble = something
-
I want to count the amount of rows returned by the mysql query. but it always returns 0. how do i do this?
$sDate = $_POST['selectedDate']; $sTitle = $_POST['selectedTitle']; $result = $wpdb->get_results( "SELECT * FROM " . $candvAdmin_availability_table_name . " WHERE car = '" . $sTitle . "' AND dateOfBooking '" . $sDate . "'" ); $countResults = count($result);
if ($countResults == 0){
echo “ok”;
}else{
echo “no”;
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘count entries in database where bla = something and ble = something’ is closed to new replies.