db::table (' topics ')->select (' topics.* ', ' b.username ', ' B.avatar ', ' C.username as Rname ', ' D.cname ')->where (' Topics.is_hidden ', 0)->leftjoin (' Users b ', ' B.uid ', ' = ', ' Topics.uid ')->leftjoin (' Users c ', ' c.uid ', ' = ', ' Topics.ruid ')->leftjoin (' Nodes d ', ' d.node_id ', ' = ', ' topics.node_id ')->orderby (' ord ', ' desc ')->take ($limit)->get ();
Error in connection query alias
SQLSTATE[42S02]: Base table or view not found:1146 table ' startbbs.stb_users B ' doesn ' t exist (Sql:select stb_topics
. *, stb_b
. username
, stb_b
. avatar
, stb_c
. username
as rname
,. From left stb_d
joins on cname
stb_topics
stb_users b
stb_b
. uid
= stb_topics
. uid
Left Join stb_users c
on stb_c
. uid
= stb_topics
. Left ruid
join stb_nodes d
on stb_d
. node_id
= stb_topics
. node_id
where stb_topics
. = is_hidden
0 Ord ER by ord
desc limit 20)
Reply content:
db::table (' topics ')->select (' topics.* ', ' b.username ', ' B.avatar ', ' C.username as Rname ', ' D.cname ')->where (' Topics.is_hidden ', 0)->leftjoin (' Users b ', ' B.uid ', ' = ', ' Topics.uid ')->leftjoin (' Users c ', ' c.uid ', ' = ', ' Topics.ruid ')->leftjoin (' Nodes d ', ' d.node_id ', ' = ', ' topics.node_id ')->orderby (' ord ', ' desc ')->take ($limit)->get ();
Error in connection query alias
SQLSTATE[42S02]: Base table or view not found:1146 table ' startbbs.stb_users B ' doesn ' t exist (Sql:select stb_topics
. *, stb_b
. username
, stb_b
. avatar
, stb_c
. username
as rname
,. From left stb_d
joins on cname
stb_topics
stb_users b
stb_b
. uid
= stb_topics
. uid
Left Join stb_users c
on stb_c
. uid
= stb_topics
. Left ruid
join stb_nodes d
on stb_d
. node_id
= stb_topics
. node_id
where stb_topics
. = is_hidden
0 Ord ER by ord
desc limit 20)
The best thing to do is to copy this SQL into the database management tool and see if it's a problem with your construction.
From the SQL you constructed, it is because the alias is prefixed with the table prefix ' STB '