<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>

ERROR - 2025-04-24 12:33:12 --> Query error: Column 'driver_id' in where clause is ambiguous - Invalid query: 
			SELECT b.book_id,
				b.driver_id            AS d_id,
				r.travel_time_to_pickup_location,
				d.driver_name,
				d.mobile_no,
				d.driver_profile_pic,
				v.image                AS vehicle_image,
				v.number,
				v.color,
				v.year,
				m.name                 AS vehicle_make,
				md.model_name,
				b.waypoints,
				b.user_journey_distance,
				b.travel_time,
				b.total_fare,
				b.conv_charge,
				b.grand_total,
				b.user_id              AS u_id,
				u.wallet_amount,
				vt.active_image        AS vehicle_type_image,
				vt.type                AS vehicle_type,
				b.ride_status, b.is_arrive
			FROM tbl_booking b
			INNER JOIN tbl_userwise_cabrequest r 
				ON r.driver_id = b.driver_id 
			   AND r.booking_id = b.book_id
			INNER JOIN tbl_driver d 
				ON d.id = b.driver_id 
			INNER JOIN tbl_vehicle v 
				ON v.driver_id = b.driver_id
			INNER JOIN tbl_vehiclemake m 
				ON m.id = v.make_id 
			INNER JOIN tbl_vehicletype vt 
				ON vt.id = b.type_id 
			INNER JOIN tbl_vehiclemodel md 
				ON md.id = v.model_id 
			INNER JOIN tbl_user u 
				ON u.id = b.user_id 
			WHERE b.user_id = 48 and driver_id!=0 and is_cancle=0 and ride_status!=3 order by b.id desc limit 1
		
ERROR - 2025-04-24 12:34:21 --> Severity: Notice --> Undefined variable: payload /home/akshay/public_html/cab/application/controllers/Api/UserApi/UserController.php 1125
ERROR - 2025-04-24 15:44:12 --> Query error: Unknown column 'b.driver' in 'where clause' - Invalid query: 
			SELECT b.book_id,
				d.driver_id         AS d_id,
				u.f_name            AS username,
				r.travel_time_to_pickup_location,
				r.driver_away,
				r.waypoints,
				r.user_journey_distance,
				b.travel_time,
				d.wallet_amount,
				b.total_fare,
				b.conv_charge,
				b.grand_total,
				b.paymenttype,
				vt.active_image     AS vehicle_type_image,
				vt.type             AS vehicle_type
			FROM tbl_booking AS b 
			INNER JOIN tbl_userwise_cabrequest r 
				ON r.driver_id = b.driver_id 
			   AND r.booking_id = b.book_id
			INNER JOIN tbl_driver d 
				ON d.id = b.driver_id
			INNER JOIN tbl_vehicletype vt 
				ON vt.id = b.type_id 
			INNER JOIN tbl_user u 
				ON u.id = b.user_id
			WHERE b.driver = 42 and b.is_cancle=0 AND b.ride_status NOT IN (2, 3) order by b.id desc limit 1
		
