dsa2c2255888 2018-10-31 10:05
浏览 23

当php从7.2.1更改为7.1.12时,查询返回不同的表

I'm changing between PHP 7.1.12 and 7.2.1 on my localhost (MAMP) so I can update my PHP accordingly to ensure nothing has broken. I have come across a strange problem where when I change between the two versions, I get different results from the SQL query.


Here's an example (same SQL query for all instances):
SELECT * FROM uploads WHERE upload_artist IN (SELECT following FROM followers WHERE follower = x) ORDER BY upload_id

PHP 7.1.12 returns:

object(stdClass)#5 (...) {
    ["user_id"]=> string(1) "6", etc...
}

Whereas PHP 7.2.1 returns (notice how it says "upload_id" instead of "user_id") [THIS IS THE CORRECT OUTPUT]:

object(stdClass)#5 (...) {
    ["upload_id"]=> string(1) "3", etc...
}


Both PHP versions are using the same flavour of MySQL and are on the same machine, using the same host. What is causing this to happen and how can I fix it?

Cheers.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭
    • ¥15 2020长安杯与连接网探
    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么