2013-10-25 6 views
0

누구나 업데이트 링크가 아래 코드의 웹 페이지에 표시되지 않는 이유를 말해 줄 수 있습니까? ('갱신'링크)업데이트 링크가 표시되지 않고 명령이 잘못 되었습니까?

{ 
echo ('You did not complete all of the required fields'); 
echo "<BR>"; 
while($rows=mysql_fetch_array($result)){ 
echo '<a href="update.php?Reference='. $rows['Reference'].' ">update</a>'; 
} 
} // end of while loop 
else { 
echo "Successful"; 
echo "<BR>"; 
echo "<a href='list_records.php'>View result</a>"; 
} 

업데이트 2

<?php 

require_once('auth.php'); 

$host="xxx"; // Host name 
$username="xxx"; // Mysql username 
$password="xxx"; // Mysql password 
$db_name="xxx"; // Database name 
$tbl_name="xxx"; // Table name 

// Connect to server and select database. 
mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
mysql_select_db("$db_name")or die("cannot select DB"); 

$Reference=$_REQUEST['Reference']; 
$directly = $_REQUEST['directly']; 
$behalfclient = $_REQUEST['behalfclient']; 
$investigations = $_REQUEST['investigations']; 
$injuries = $_REQUEST['injuries']; 
$duties = $_REQUEST['duties']; 
$Wherepain = $_REQUEST['Wherepain']; 
$pain = $_REQUEST['pain']; 
$aggravates = $_REQUEST['aggravates']; 
$eases = $_REQUEST['eases']; 
$Movement = $_REQUEST['Movement']; 
$neural = $_REQUEST['neural']; 
$UnderstandNPRS = $_REQUEST['UnderstandNPRS']; 
$NPRSassessment = $_REQUEST['NPRSassessment']; 
$yourhobbies = $_REQUEST['yourhobbies']; 
$hobbiesaffected = $_REQUEST['hobbiesaffected']; 
$social = $_REQUEST['social']; 
$activities = $_REQUEST['activities']; 
$lifestyle = $_REQUEST['lifestyle']; 
$avoiddriving = $_REQUEST['avoiddriving']; 
$grip = $_REQUEST['grip']; 
$flashbacks = $_REQUEST['flashbacks']; 
$braking = $_REQUEST['braking']; 
$past = $_REQUEST['past']; 
$psychologically = $_REQUEST['psychologically']; 
$stomach = $_REQUEST['stomach']; 
$dental = $_REQUEST['dental']; 
$organs = $_REQUEST['organs']; 
$genitals = $_REQUEST['genitals']; 
$memory = $_REQUEST['memory']; 
$scaring = $_REQUEST['scaring']; 
$deformity = $_REQUEST['deformity']; 
$eyes = $_REQUEST['eyes']; 
$burns = $_REQUEST['burns']; 
$head = $_REQUEST['head']; 
$symptoms = $_REQUEST['symptoms']; 
$otherchanges = $_REQUEST['otherchanges']; 
$receivingtreatment = $_REQUEST['receivingtreatment']; 
$surgery = $_REQUEST['surgery']; 
$Impression = $_REQUEST['Impression']; 
$management = $_REQUEST['management']; 
$ifyes = $_REQUEST['ifyes']; 
$Rehabilitation = $_REQUEST['Rehabilitation']; 
$Number = $_REQUEST['Number']; 
$Psychological = $_REQUEST['Psychological']; 
$diagnostic = $_REQUEST['diagnostic']; 
$notrequiretreatment = $_REQUEST['notrequiretreatment']; 
$house = $_REQUEST['house']; 
$recommendations = $_REQUEST['recommendations']; 
$Prognosis = $_REQUEST['Prognosis']; 
$CV = $_REQUEST['CV']; 
$cervical = $_REQUEST['cervical']; 
$heat = $_REQUEST['heat']; 
$ice = $_REQUEST['ice']; 
$lumbar = $_REQUEST['lumbar']; 
$medication = $_REQUEST['medication']; 
$posture = $_REQUEST['posture']; 
$sport = $_REQUEST['sport']; 
$given = $_REQUEST['given']; 
$sceneaccident = $_REQUEST['sceneaccident']; 

$sql="UPDATE Triage SET sceneaccident='$sceneaccident', notrequiretreatment='$notrequiretreatment', house='$house', recommendations='$recommendations', Prognosis='$Prognosis', CV='$CV', cervical='$cervical', heat='$heat', ice='$ice', lumbar='$lumbar', medication='$medication', posture='$posture', sport='$sport', given='$given' ,organs='$organs', deformity='$deformity', otherchanges='$otherchanges', receivingtreatment='$receivingtreatment', surgery='$surgery', Impression='$Impression', management='$management', ifyes='$ifyes', Rehabilitation='$Rehabilitation', Number='$Number', Psychological='$Psychological', diagnostic='$diagnostic', eyes='$eyes', burns='$burns', head='$head', symptoms='$symptoms', memory='$memory', scaring='$scaring', genitals='$genitals', dental='$dental', stomach='$stomach', directly='$directly', behalfclient='$behalfclient', investigations='$investigations', injuries='$injuries', duties='$duties', Wherepain='$Wherepain', pain='$pain', aggravates='$aggravates', eases='$eases', Movement='$Movement', neural='$neural', UnderstandNPRS='$UnderstandNPRS', NPRSassessment='$NPRSassessment', yourhobbies='$yourhobbies', hobbiesaffected='$hobbiesaffected', social='$social', activities='$activities', lifestyle='$lifestyle', avoiddriving='$avoiddriving', grip='$grip', flashbacks='$flashbacks', braking='$braking', past='$past', psychologically='$psychologically' WHERE Reference='$Reference'"; 
$result=mysql_query($sql); 


if (!$_REQUEST['sceneaccident'] || !$_REQUEST['notrequiretreatment'] || !$_REQUEST['house'] || !$_REQUEST['recommendations'] || !$_REQUEST['Prognosis'] || !$_REQUEST['CV'] || !$_REQUEST['cervical'] || !$_REQUEST['heat'] || !$_REQUEST['ice'] || !$_REQUEST['lumbar'] || !$_REQUEST['medication'] || !$_REQUEST['posture'] || !$_REQUEST['sport'] || !$_REQUEST['given'] || !$_REQUEST['organs'] || !$_REQUEST['deformity'] || !$_REQUEST['otherchanges'] || !$_REQUEST['receivingtreatment'] || !$_REQUEST['surgery'] || !$_REQUEST['Impression'] || !$_REQUEST['management'] || !$_REQUEST['ifyes'] || !$_REQUEST['Rehabilitation'] || !$_REQUEST['Number'] || !$_REQUEST['Psychological'] || !$_REQUEST['diagnostic'] || !$_REQUEST['eyes'] || !$_REQUEST['burns'] || !$_REQUEST['head'] || !$_REQUEST['symptoms'] || !$_REQUEST['memory'] || !$_REQUEST['scaring'] || !$_REQUEST['genitals'] || !$_REQUEST['dental'] || !$_REQUEST['stomach'] || !$_REQUEST['directly'] || !$_REQUEST['behalfclient'] || !$_REQUEST['investigations'] || !$_REQUEST['injuries'] || !$_REQUEST['duties'] || !$_REQUEST['Wherepain'] || !$_REQUEST['pain'] || !$_REQUEST['aggravates'] || !$_REQUEST['eases'] || !$_REQUEST['Movement'] || !$_REQUEST['neural'] || !$_REQUEST['UnderstandNPRS'] || !$_REQUEST['NPRSassessment'] || !$_REQUEST['yourhobbies'] || !$_REQUEST['hobbiesaffected'] || !$_REQUEST['social'] || !$_REQUEST['activities'] || !$_REQUEST['lifestyle'] || !$_REQUEST['avoiddriving'] || !$_REQUEST['grip'] || !$_REQUEST['flashbacks'] || !$_REQUEST['braking'] || !$_REQUEST['past'] || !$_REQUEST['psychologically']) 

{ 
echo ('You did not complete all of the required fields'); 
echo "<BR>"; 
while($rows=mysql_fetch_array($result)){ 
echo '<a href="update.php?Reference='. $rows['Reference'].' ">update</a>'; 
} 
} // end of while loop 
else { 
echo "Successful"; 
echo "<BR>"; 
echo "<a href='list_records.php'>View result</a>"; 
} 

?> 
+0

BTW 선택하여 업데이트 쿼리를 fetch.Change하는 값을 포함하지 않습니다 while 루프는 생각보다 일찍 종료됩니다. 그리고이 메소드 (mysql_)는 이제 더 이상 사용되지 않습니다. – Strawberry

+0

while 루프에서'=='대신'1'= ' –

+0

@SidM을 사용하십시오. 하나 대신 ==를 시도했지만 브라우저가 이제 지 웁니다. 어떤 아이디어? –

답변

0

루프는하지 않지만 값. $ 결과는 쿼리를

+0

그냥 확인하려면, 나는 $ sql = "$ sql ="SELECT로 업데이트하거나 포인트를 놓치고 있습니다, 건배 –

관련 문제