I am very new to the laravel subqueries , i am trying to fetch another table data but it's showing an following error
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT tl_titlename FROM bm_titlelist WHERE tl_titleid=1 from `bm_customercon...' at line 1 (SQL: select SELECT tl_titlename FROM bm_titlelist WHERE tl_titleid=1 from `bm_customercontactinfo`)
query
DB::enableQueryLog();
$data = DB::table('bm_customercontactinfo')
->select(
DB::raw("SELECT tl_titlename FROM bm_titlelist WHERE tl_titleid=1")
)
->get();
dd(DB::getQueryLog());
can anyone help me where did i mistake ?