위를 PHP에서 ID로 특정 필드를 업데이트하면 내 페이지의 스크린 샷이다.
이<?php
$s="select * from events join event_time on (events.event_id=event_time.event_id)
where events.isapproved='N' ";
$res=mysql_query($s);
echo "<table border='1' cellspacing='2' >
<tr>
<th>title</th>
<th>email</th>
<th>address</th>
<th>link</th>
<th>start_date</th>
<th>start_time</th>
<th>end_date</th>
<th>isapproved</th>
</tr>";
while($info = mysql_fetch_array($res))
{
echo "<tr>";
echo " <td>".$info['title'] . "</td> ";
echo " <td>".$info['email'] . "</td> ";
echo " <td>".$info['address'] . "</td> ";
echo " <td>".$info['link'] . "</td> ";
echo " <td>".$info['start_date'] . "</td> ";
echo " <td>".$info['start_time'] . "</td> ";
echo " <td>".$info['end_date'] . "</td> ";
echo "<td><a href=yes.php?".$info['event_id'] .">".$info['isapproved'] ."</a></td>";
echo "<td><a href=del.php?".$info['event_id'].">".'Delete'."</a></td></tr>";
}
echo "</table>";
?>
내가 대한 액세스를 시도하고있는 무슨 하이퍼 링크가 yes.php
<?php
include("config/config.php");
$sq="select * from events";
$res=mysql_query($sq);
while($row=mysql_fetch_assoc($res))
{
if($row['isapproved']=='N')
{
$id=$row['event_id'];
}
}
$sql="UPDATE events SET isapproved= 'Y'
WHERE event_id='$id'";
$result = mysql_query($sql);
header("Location:admin.php");
?>
입니다 : 내 문제는 내가 내 SQL 테이블에서 데이터를 받고이 같은 PHP는 데이터 테이블을 만드는거야입니다 이 함수는 하이퍼 링크 "N"을 클릭하면 값이 "Y"인 테이블을 업데이트해야합니다 (쿼리에서 볼 수있는 것처럼).
실제 문제는 "N"을 클릭 할 때 id가 표시되지만 검색어 gt가 "Y"로 업데이트되는 테이블 하단의 행을 업데이트 할 때입니다. 문제가 무엇입니까?
$sq="select * from events";
$res=mysql_query($sq);
while($row=mysql_fetch_assoc($res))
{
if($row['isapproved']=='N')
{
$id=$row['event_id'];
}
}
당신은 $id
에서 (덮어 쓰기) 모든 승인되지 않은 이벤트의 ID를 잡는 그들을 저장됩니다 사람이 그것으로 볼 수 ..이 코드와
당신이 위해서 var_dump를하고 우리에게 렌더링 된 HTML에서 몇 행을 표시 할 수 있습니다, 그래서 우리 N과 Y에 어떤 값이 있는지 알 수 있습니까? –
기존 행을 모두 한 번의 클릭으로 업데이트 하시겠습니까 ??? 또는 클릭 한 행만 업데이트 하시겠습니까? –