Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello guys i am facing a problem that i want to get start_date from database but i get only null values its not showing values

please check this image for better understanding https://imgur.com/eCrGeTW here is the code

What I have tried:

JavaScript
$data = \DB::table("subscriptions")
->select("subscriptions.*",
\DB::raw("(SELECT subscriptions.start_date FROM subscriptions
WHERE subscriptions.business_id = $business_id
) as date"))
->orderBy('subscriptions.start_date', 'desc')
->get();
dd($data);
Posted
Updated 10-Dec-19 1:16am
v2
Comments
Richard MacCutchan 10-Dec-19 4:20am    
That image shows nothing useful and it is not clear why your code fails. Maybe the select clause just cannot find any records matching your search data (what is in $business_id). Use your debugger to capture more information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900