mysql Selecting from two different tables.

后端 未结 9 763
终归单人心
终归单人心 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:02

    You should use aliases or table name to avoid the duplicate problem like this

    tablename.column
    

    or

    alias.column
    

    you can set the alias in your where clause :

    FROM table as alias_name
    

提交回复
热议问题