mysql Selecting from two different tables.

后端 未结 9 865
终归单人心
终归单人心 2021-01-28 05:01
$sql = \"select body, stamp from posts where user_id = \'$userid\' order by stamp desc\";

NOTE: the above query works fine. What I want to do is also s

9条回答
  •  粉色の甜心
    2021-01-28 06:05

    $sql = "select body, stamp from posts , username from users where user_id = '$userid' order by stamp desc";
    

    I just corrected the syntactical error in your query... that is the AND keyword should be replaced by ,.

提交回复
热议问题