我在一台服务器上有以下代码。它工作正常。
$developer_id = $_SESSION['auth']['id'];
$sql = "select sum(file_size) as total_storage_size, (select count(*) from language_set where developer_id = :DEVELOPER_ID) as total_projects, (select count(*) from testing_group where developer_id = :DEVELOPER_ID) as total_test_apps, (select count(*) from published_group where developer_id = :DEVELOPER_ID) as total_published_apps, account_type from resource JOIN language_set on resource.set_id = language_set.id JOIN developer on developer_id = developer.id where developer_id = :DEVELOPER_ID";
$stmt = $dbh->prepare($sql);
$stmt->bindParam(":DEVELOPER_ID", $developer_id, PDO::PARAM_INT);
$stmt->execute();
$account_info = $stmt->fetch(PDO::FETCH_ASSOC);
但是,当我将其移动到另一台服务器时,它会给出错误的结果。例如,它将account_type设为“NULL”而不是“standard”。
我已将问题追溯到以下问题:
以下是我的问题:
答案 0 :(得分:0)
在PHP7中,类型转换更为重要。
在PHP5中你可以这样做:
$ a =“9”; 打印(9 * $ a);
在PHP7中:
$ a =“9”; print(9 *(int)$ a);