Someone please help me! I'm a beginner. I got this code earlier, and the only problem with it is that I can't refer to an array which is supposed to store the values of the 3rd column containing email addresses of each updated record. I highlighted where the problems might be. This is a multiple checkbox updating of a table, but the code is a bit complicated for me. If someone could provide an easier, more readable code doing the exact same thing would be highly appreciated. Thanks in advance.
Best regards,
Akos, Hungary
<?
$dbhost = MYHOST ;
$dbuser = MYUSER ;
$dbpass = MYPASS ;
$db = mysql_connect($dbhost,$dbuser,$dbpass) or die("Hiba a kapcsolódáskor!") ;
$dbname = "gepek" ;
mysql_select_db($dbname,$db) ;
if ($submit)
{
for($i = 0 ; $i<count($action_items) ; $i++)
{
$query = sprintf("update hiba set javitva = 'igen'
where sorszam = '%s'",$action_items[$i]) ;
mysql_query($query,$db) ;
mail(HOW THE HELL CAN I REFER TO THE 3RD COLUMN OF THE UPDATED RECORDS WHERE THERE IS AN EMAIL ADDRESS,"Az On altal bejelentett hiba javitva!",
"Koszonom az egyuttmukodest: David Akos") ;
}
}
$result = mysql_query("select sorszam,bejelento_email_cime,date_format(rogzites_ideje,'%Y-%m-%d %T') as date_time,leiras,leltari_szam,hibakod from hiba where javitva = 'nem'
?>
<head><title>Rogzitett hibak listaja</title>
</head>
<body>
<h1>Rogzitett hibak listaja</h1>
<h3>(Jelölje be a kijavitott hibakat, majd kattintson a Frissit
gombra!)</h3>
<table border="3" cellspacing="5" cellpadding="5">
<form action="<? print $PHP_SELF ; ?>" method="post">
<?
while ($row = mysql_fetch_array($result))
{
printf('<tr><td><input type="checkbox" name="action_items[]"
value="%s"><INPUT TYPE="HIDDEN" NAME="EMAIL_ITEMS[]" VALUE="%s"></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>,$row["sorszam"],$row["bejelento_email_cime"],$row["sorszam"],$row["bejelento_email_cime"],$row["date_time"],$row["leiras"],$row["leltari_szam"],$row["hibakod"]) ;
}
?>
<tr>
<td align="left"><input type="submit" name="submit" value="Frissit"></td>
</tr>
</table>
</form>
<a href="dolg_menu.html">Vissza</a>
</body>