im having another problem the script below is supposed to validate information in my database...at the moment any data can not be viewed on screen until a field 'status' in my database is set from 'N' to 'Y' the script to do this isnt doing it could you look to see why?
<?
include "common.php";
include "header.php";
$link = mysql_connect("$server", "$username", "$password")
or die("Could not connect");
mysql_select_db("$db") or die("Could not select database");
$query = "select * from escorts2 where status='N'" or die (mysql_error());
$result = mysql_query($query) or die("Query failed");
if (mysql_num_rows($result) > 0) {
echo "<form action=\"clean.php\" method=\"post\">";
while ($rows=mysql_fetch_array($result)) {
echo "
<table align=center width=90% border=0 cellpadding=3 cellspacing=0>
<tr><td Bgcolor=#7F7F7F><font size=2 color=white>ID # $rows[id]</font> </td></tr>
<tr><td bgcolor=#C0C0C0>";
?>
<font>Name:<? echo $rows[name]?></font><BR>
<font>Email Address: <? echo $rows[email]?></font><BR>
<font>Country: <? echo $rows[country]?></font><BR>
<font>Location: <? echo $rows[location]?></font><BR>
<font>City: <? echo $rows[city]?></font><BR>
<font>Height: <? echo $rows[height]?></font><BR>
<font>Stats: <? echo $rows[stats]?></font><BR>
<font>Age:<? echo $rows[age]?></font><BR>
<font>Rates:<? echo $rows[rates]?></font><BR>
<font>Description:<? echo $rows[description]?></font><BR>
<SELECT NAME="a[]">
<option value="Ignore Site">Ignore Site</option>
<option value="Add Site">Add Site</option>
<option value="Reject Site">Reject Site</option>
</SELECT>
<BR>
<font>Reject Reason:</font><BR>
<input size="50" type="text" name="reason[]"><BR>
<BR>
<center>
<BR>
<input type=hidden name="id[]" value="<? echo $rows[id]?>">
<input type=hidden name="status[]" value="<? echo $rows[status]?>">
</center>
<?
echo "</td></tr></table><BR>";
}
echo "<center><input type=\"submit\" name=\"submit\"></center></form>";
}
else {
?>
<table align=center width=90% border=0 cellpadding=3 cellspacing=0>
<tr>
<td bgcolor="#eeeeee" align="center"><br><font size="2">Sorry, there are no sites to validate.</font><br><br></td>
</tr>
</table>
<?
}
include "footer.php";
?>
and the script that the form above actions to is below
<?
include "common.php";
include "header.php";
$insert_count=$delete_count=$ignored_count=0;
$num_rows=count($id);
$link = mysql_connect("$server", "$username", "$password")
or die("Could not connect");
mysql_select_db("$db") or die("Could not select database");
for($i = 0; $i < $num_rows; ++$i){
if($a[$i]=="Add Site"){
$query = "UPDATE escorts2 SET status='Y' WHERE id=$id[$i]" or die(mysql_error());
$msg = "Welcome $name to Adultinfo4u.co.uk escort listings.\n Your listing has been accepted.\n";
mail($email[$i],"Site Accepted.",$msg,"From: $admin_email\nReply-To: $admin_email");
++$insert_count;
}
if($a[$i]=="Reject Site"){
$query = "DELETE from escorts2 WHERE id=$id[$i]" or die (mysql_error());
$msg = "Sorry $name.\n Your Listing has been rejected from Adultinfo4u.co.uk.\n Reason: $reason[$i].";
mail($email[$i],"Site Rejected.",$msg,"From: $admin_email\nReply-To: $admin_email");
++$delete_count;
}
}
$ignored_count=$num_rows-$insert_count-$delete_count;
?>
<table align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
<tr>
<td align="center" bgcolor="#eeeeee"><br><table>
<tr>
<td><font face="<? echo $font_face;?>" size="2">
<? echo $insert_count;?> Sites were added.<br><br>
<? echo $delete_count;?> Sites were rejected.<br><br>
<? echo $ignored_count;?> Sites were ignored.<br><br><br>
<a href="validate.php">Click Here to Continue</a>
</font><br><br></td>
</tr>
</table></td>
</tr>
</table>
<?
include "footer.php";
?>
If you can solve this then ur a wizard as I have had hours of head aches trying to figure this out...thanks.