Hej jeg har lavet et partner system hvor man kan acceptere partnere, den udskriver jeg har 2 partnere, men den udskriver kun den første, det var første fejl, så gider den heller ikke rigtig at acceptere partnere hvis jeg har fx. 5 partnere, nogen som kan se fejlen?
<?php
session_start();
if(!isset($_SESSION['brugernavn']))
{
header("location:../fejl.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Accepter partnere</title>
<link href="../../../style/indhold.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Godkend ansøgninger</h1><br />
<?php
include("../config.php");
$select = mysql_query("SELECT * FROM `partners` WHERE `status` = '0'") or die(mysql_error());
$number = mysql_num_rows($select);
if($number == 1) {
echo "Der er <b>1</b> Ansøning.";
} else {
echo "Der er <b>$number</b> Ansøninger.";
}
echo "<br /><b /><img src='../../../images/linje.jpg' /><br /><br /><b>Ansøgninger:</b><br /><br />";
$vis = mysql_fetch_array($select);
if($_GET["action"] == "accept") {
$name = $vis["partner_name"];
mysql_query("UPDATE partners SET status = '1' WHERE partner_name = '$name' LIMIT 1") or die(mysql_error());
$msg = "<br />". $name ."er nu accepteret!";
}
if($_GET["action"] == "decline") {
$name = $vis["partner_name"];
mysql_query("DELETE FROM partners WHERE `partner_name` = '$name' LIMIT 1") or die(mysql_error());
$msg = "<br />". $name ." er nu afslået!";
}
?>
<table width="420" border="0">
<tr>
<td width="108"><b>Banner:</b></td>
<td width="170"><b>Link:</b></td>
<td width="83"><b>Accepter</b></td>
<td width="72"><b>Afslå</b></td>
</tr></table><br />
<table width="420" border="0">
<?php while($row = mysql_fetch_array($select)) { ?>
<tr>
<td width="108" height="40"><img src="<?php echo $row['partner_pic']; ?>" style="border:1px solid; border-color:#000000;" /></td>
<td width="170"><a target="_blank" href="<?php echo $row['partner_url']; ?>"><?php echo $row['partner_url']; ?></a></td>
<input type="hidden" value="<?php echo $row['partner_name']; ?>" name="name">
<td width="83"><a href="accepter.php?action=accept">Accepter</a></td>
<td width="72"><a href="accepter.php?action=decline">Afslå</a></td>
</tr>
</table>
<br />
<?php
}
echo $msg;
?>
</body>
</html>