php - Mysql syntax error on LEFT JOIN query -


i trying execute left join query getting syntax error:

you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'left join lr_users on lr_capped_members.user = lr_users.user_id wher' @ line 2

i have checked code errors (ie: missing commas, incorrect table names, etc), can not find fault. maybe have tunnel vision form working on code day appreciate assistance. please find below code.

$member_qry = mysqli_query($con, "select lr_capped_members.user, lr_users.username              left join lr_users on lr_capped_members.user = lr_users.user_id             cap_week = '$week'     ")or die(mysqli_error($con)); 

you forgot from part of query. you'll want write :

$member_qry = mysqli_query($con, "select lr_capped_members.user, lr_users.username          lr_capped_members         left join lr_users on lr_capped_members.user = lr_users.user_id         cap_week = '$week' ")or die(mysqli_error($con)); 

Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -