need help with script it pulls the id from MAKE_ITEM_Group then gets name of item from item table and displays the info but running into excution errors can some look at script see whats wrong
thanks -Advocate
thanks -Advocate
PHP:
<?php
$dbserver = "*";
$dbuser = "*";
$dbpass = "*";
$db = "*";
$msconnect=mssql_connect($dbserver, $dbuser, $dbpass) or die("Error connecting to {$dbserver}.\r\n<br />");
$id = $_GET['id'];
if(is_numeric($id))
{
echo "<table><tr><td>Num</td><td>strName</td></tr>";
mssql_select_db($dbtable) or die ("Error switching to {$dbtable} table.\r\n<br />");
$ITEM_GROUP="SELECT iItem_1, iItem_2, iItem_3, iItem_4,
iItem_5, iItem_6, iItem_7, iItem_8,
iItem_9, iItem_10, iItem_11, iItem_12,
iItem_13, iItem_14, iItem_15, iItem_16,
iItem_17, iItem_18, iItem_19, iItem_20,
iItem_21, iItem_22, iItem_23, iItem_24,
iItem_25, iItem_26, iItem_27, iItem_28,
iItem_29, iItem_30
from MAKE_ITEM_GROUP
WHERE iItemGroupNum = '{$id}';";
$query=mssql_query($ITEM_GROUP) or die("Error running {$ITEM_GROUP}\r\n<br />");
while ($result=mssql_fetch_row($query))
{
sort($result, SORT_NUMERIC);
for ($i=;$i<count($result);$i++)
{
$item="SELECT Num, strName from Item where num=".$item_array[$i].";";
$item=$mssql_query($item);
while ($result2=mssql_fetch_row($item))
{
echo "<tr><td>{$result2[0]}</td><td>{$result2[1]}</td></tr>";
}
}
}
echo "</table>";
}
else
{
echo "The passed string must be a numeric value";
}
?>