Array / mysql problem [solved]
Posted: Wed May 25, 2005 2:45 pm
Can any one take a look at this and see what I may be missing?
The problem is with the variable $planned_date I may have my syntax confused. Im not sure. I did try to have it comming out of the array like this $array['$field_name'] but that didn't work for me either. All code is below...
Thanks for any and all help.
Chris
The problem is with the variable $planned_date I may have my syntax confused. Im not sure. I did try to have it comming out of the array like this $array['$field_name'] but that didn't work for me either. All code is below...
Thanks for any and all help.
Chris
Code: Select all
<?
$mailings = mysql_list_fields("sapcdb", "mail_schedule", $link) or die(mysql_error());
$totalcount = mysql_num_fields($mailings);
$group_query = mysql_query("SELECT * FROM `mail_schedule` WHERE `group_id` = '$g'");
$group_array = mysql_fetch_array($group_query, MYSQL_ASSOC);
?>
<br>
Viewing Group: <? echo $g; ?><br>
Total Mailings In Cycle: <? print $totalcount; ?><br><br>
To initialize this group's mailing cycle,
<a href="/admin/admissions/main/mailing/initializegroup.php?g=<? echo $g; ?>">
click here</a>.<br>
<br>
<form name="form1" method="post" action="">
<table>
<?
for ($i = 1; $i < $totalcount; $i++) {
$fieldname = mysql_field_name($mailings, $i);
$planned_date = $group_array[$field_name];
print $planned_date;
print "<tr>\n
<td>$fieldname</td>\n
<td><input name=\"$fieldname\" type=\"text\" value=\"$planned_date\"></input><br></td> \n
</tr>\n";
}
?>
<br>
<br>
</table>
<input type="submit" name="Submit" value="Submit">
</form>