我有一个网页,它将根据用户将进行的某个下拉选择显示信息。为了查看数据,我运行了多个查询以确定将显示哪些数据。如果我只使用 1 个查询和 pdo 语句,它对我有用。但是,我有多个查询和 pdo 语句,当我尝试使用多个查询时,我得到一个Internal Server Error
.
谁能提供一些关于问题可能是什么的建议?这是我的一个查询和 PDO 语句的示例:
$_400p_1_1 = "SELECT CAST([Program_ID] AS INT) AS Program_ID
,CAST([Series] AS INT) AS Series
,[Supplier_Group_Name]
,[Buyer Group Name]
,[Fund Name]
,CAST([Agreement_ID] AS INT) AS Agreement_ID
,[Location Group Name]
,[Product Group Name]
,[Shipping Group Name]
,CAST([Tier_ID] AS INT) AS Tier_ID
,[Retro_to_1]
,CAST([Payments per Year] AS INT) AS [Payments per Year]
,[Condition Unit of Measure]
,CAST([Condition Minimum] AS INT) AS [Condition Minimum]
,CAST([Condition Maximum] AS INT) AS [Condition Maximum]
,CAST([Incentive Multiplier] AS DEC(5,4)) AS [Incentive Multiplier]
FROM [test].[dbo].[vExample]
WHERE [Supplier_Group_Name] = '$supp' AND [Series] = 1 AND [Fund Name] = '400P' AND [Agreement_ID] = 1
ORDER BY [Supplier_Group_Name]";
$stmt = $pdo->prepare($_400p_1_1);
$stmt->execute();
$results1 = $stmt->fetchAll();
这是一个引入要显示的信息的示例:
<label>Program ID:</label><input value="<?php echo $results1[0]['Program_ID'];?>" readonly>
我还应该提到,位于 中的下拉选择page1.php
是通过 AJAX 发送到update.php
查询和 PDO 语句所在的位置,以及其他 HTML/PHP 代码。同样,如果我只使用一个查询和一个 PDO 语句,它就可以正常工作。