Save custom post type in different table

While I am a big fan of tweaking wordpress as much as it could because it allows us to, I think the best way forward is to have the best algorithm before coding.

Reading your question, I came across ” Actually, I have created two custom post type named 'truck' and 'drivers' “.

Issue: Linking two post types requires extra work as you are doing because natively it is not what WordPress does.

Suggested Solution: Do it, the way WP works naturally: Link a Custom Post Type to a taxonomy. So, instead of having ‘truck’ and ‘drivers’ as CPTs, have ‘drivers’ as CPT and ‘trucks’ as taxonomy! That saves you tons of work, and especially the risk of running into issues should WP Update.

You can then create the custom functionality of dragging and dropping on CPT and taxonomy

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)