Hello again,
I am having a hard time trying to get a values from my array. I have an array called ven. This array is created from form inputs and has a variable key. Look at the following to see how I am doing this:
while ($row = mysql_fetch_assoc($result))
{
echo "<TR valign='top'><td class='content'><input type='radio' name='application[".$i."]' value='appr - ".$row['app_id']."'></td><td class='content'><input type='radio' name='application[".$i."]' value='rej - ".$row['app_id']."'></td><td class='content'><font size='-1'><input type='text' name='ven[".$row['app_id']."]'</font></td><td class='content'><font size='-1'>".$row['user_owner']."</font></td><td class='content'><font size='-1'>".$row['app_access_for']."</font></td></tr>";
$i++;
}
on the action page I step through the application array, assign variables and perform a couple different queries.
$array = $_GET['application'];
foreach($array as $value)
{
$dash_loc = strpos($value, '-');
$total_len = strlen($value);
$app_id = substr($value, $dash_loc + 1, $total_len);
$action = substr($value, 0, $dash_loc - 1);
$ven_num = $_GET['ven'];
if ($action == 'appr')
{
$query2 = "select a.user_owner, a.uid, b.app_access_for from eCom_users a, eCom_approval b where a.uid = b.app_uid and b.app_id = '".$app_id."'";
$result2 = mysql_db_query($db,$query2,$connection) or die (mysql_error());
$query = "update eCom_approval set app_granted_on = '".date('Y-m-d')."', app_granted_by = '".$_SESSION['uid']."' where app_id = '".$app_id."'";
$result = mysql_db_query($db,$query,$connection) or die (mysql_error());
while ($row = mysql_fetch_assoc($result2))
{
echo "<font class='content' color='green'>Access has been granted for ".$row['user_owner']." to ".$ven_num["$app_id"]."<BR>";
//$query3 = "insert into eCom_logs (uid, log_message) values ('".$row['uid']."', 'access for ".$row['app_access_for']." granted by admin ".$_SESSION['uid']."')";
//$result3 = mysql_db_query($db,$query3,$connection) or die (mysql_error());
//$query4 = "update ecom_users set user_access = '".$_GET[$app_id]."' where uid = '".$row['uid']."'";
//$result4 = mysql_db_query($db,$query4,$connection) or die (mysql_error());
}
}
}
When I try to echo $ven_num["$app_id"] I get nothing. How can I do this? I have also tried $ven_num[$app_id] and $ven_num['$app_id'] with no avail.