我有一个网页,它会根据用户将选择的某个下拉列表选项显示信息。为了查看数据,我有多个查询运行以确定将显示哪些数据。如果我只使用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发送到查询和PDO语句所在的update.php
,以及其他HTML / PHP代码。同样,如果我只使用一个查询和一个PDO语句,它的工作正常。