SQL query returns incorrect value for ID column in PHP

后端 未结 1 1593
鱼传尺愫
鱼传尺愫 2021-01-25 10:43

I am using the following SQL query to extract content from the tables posts, users and comments

When I run the query o

相关标签:
1条回答
  • 2021-01-25 10:51

    Multiple tables in your query have ID column. Use field aliases instead of * in select. For example,

    SELECT posts.id as post_id, ..... FROM posts ....

    Or you can get the right id using $thisResult[0] (assuming id is the first column in posts table)

    0 讨论(0)
提交回复
热议问题