Thanks a lot, Martin!
The problem is solved, but another one has emerged. Here is my script which is supposed to do a multiple deletion with checkboxes. That is beautiful. But there is a field LEIRAS (stands for "description") which doesn't necessarily contains information as the user might leave this field empty. But when this script displays the table I want to replace all the empty LEIRAS fields with in the table (it looks much better). I know that I can do this with creating an IF structure like this:
if (LEIRAS == "")
{
<td> <? echo ; ?> </td>
}
else
{
displaying LEIRAS
}
But I can't find my way between the symbols %. I got this help earlier but it's still not clear what exactly I can do with this SPRINTF function. Could please help me and fix the code or tell me what the solution is?
Thanks,
the Hungarian
<?
$dbhost = HOST ;
$dbuser = USER ;
$dbpass = PASSWORD ;
$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("delete from hiba where sorszam = '%s'",$action_items[$i]) ;
mysql_query($query,$db) ;
}
}
$result = mysql_query("select sorszam,bejelento_email_cime,date_format(rogzites_ideje,'%Y-%m-%d %T') as
date_time,leiras,leltari_szam,hibakod,javitva from hiba order by sorszam desc",$db) ;
?>
<head><title>Rogzitett hibak listaja</title>
</head>
<body>
<h1>Rogzitett hibak listaja</h1>
<h3>(Jelölje ki a torolni kivant rekordokat, majd kattintson a Torol
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"></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',$row["sorszam"],
$row["sorszam"],$row["bejelento_email_cime"],$row["date_time"],$row["leiras"],$row["leltari_szam"],$row["hibakod"],$row["javitva"]) ;
}
?>
<tr>
<td align="left"><input type="submit" name="submit" value="Torol"></td>
</tr>
</table>
</form>
<a href="admin_menu.html">Vissza</a>
</body>