arcticvman
MIS
Hello,
I am still learning PHP and am in need of help.
What I am trying to do is select a part number from a mssql database, return it to a table as a variable that is a hyperlink. When selected by the user that it would then be passed to another query that shows details.
I hope this is easy to understand.
I have included what I am currently doing.
Any and all help would be appreciated.
I am still learning PHP and am in need of help.
What I am trying to do is select a part number from a mssql database, return it to a table as a variable that is a hyperlink. When selected by the user that it would then be passed to another query that shows details.
I hope this is easy to understand.
I have included what I am currently doing.
Any and all help would be appreciated.
Code:
<HTML>
<HEAD>
<TITLE>Results Page</TITLE>
</HEAD>
<BODY>
<?php
//connect to a DSN "myDSN"
$conn = odbc_connect('database','userid','password');
if ($conn)
{
$query = "select
item_no AS Item_Number,
item_desc_1 AS Description
FROM itemmaster_sql
WHERE user_def_fld_2 = '1'";
$result=odbc_exec($conn, $query);
}
else echo "Hey goober, check your server connection.";
?>
<table bgcolor=#F0F8FF border=1 style=" font-family:arial;font-size:95%;color:black;">
<caption><B></B></caption>
<tr>
<th>Item Number</th>
<th>Description</th>
</tr>
<?php
while($row=odbc_fetch_array($result)){
echo "<tr> <td align=center>";
echo "<a href=combinedquery.php?post=?php echo $row ['Item_Number']>";
echo $row ['Item_Number'];
echo "<td align=left>";
echo "<a href=combinedquery.php?post=?php echo $row ['Item_Number']>";
echo $row ['Description'];
}
echo "</table>";
?>
</BODY>
</HTML>