Updated query for join table creation

Removed mysql now using mysqli