$sql= " select * from table where name = '$_POST[name]' order by id";
$query = odbc_exec($sql);
$row = odbc_fetch_array($query);
$textname = $row['name'];
if($_POST['name'] = "name"){
$sql2= " select * from table2 where name = '$_POST[name]' order by id";
$query2 = odbc_exec($sql2);
$row2 = odbc_fetch_array($query2);
$textname2 = $row2['name2'];
}
Code (ASP)
<asp:SqlDataSource
ID="DS_Sale_Item"
runat="server"
ConnectionString="<%$ ConnectionStrings:ConSOH_SAP %>"
SelectCommand="SELECT ROW_NUMBER() OVER(ORDER BY SerialCode) AS No, dbo.t_GiDetail.PalletCode
FROM dbo.t_GiDetail WHERE (PalletCode = @palletcode) ORDER BY SerialCode">
<SelectParameters>
<asp:Parameter Name="PalletCode" />
</SelectParameters>
</asp:SqlDataSource>
<% if (PalletCode = "@PalletCode") %>
<asp:SqlDataSource
ID="DS_Sale_Item"
runat="server"
ConnectionString="<%$ ConnectionStrings:ConSOH_SAP %>"
SelectCommand="SELECT ROW_NUMBER() OVER(ORDER BY SerialCode) AS No,KKC_Loading.dbo.tran_Job.DeliveryDate
FROM KKC_Loading.dbo.tran_JobDo
WHERE (PalletCode = @palletcode) ORDER BY SerialCode"
<SelectParameters>
<asp:Parameter Name="PalletCode" />
</SelectParameters>
</asp:SqlDataSource>
<% } %>
Tag : PHP, Ms SQL Server 2008, Web (ASP.NET), WebServices, C#, Google Chrome