这是我想要做的事情
我想在客户第一次填写我的调查时获取第一个条目中某个列的值并将其与新的比较
所以这是我的代码
<?php
$datCurrent = $_SESSION['question11'];
$con = mysql_connect('localhost','root','');
mysql_select_db('esm_quiz', $con);
$countRow = mysql_query("SELECT COUNT(code_exp) FROM esm_resultat");
if(mysql_result($countRow, 0) == 2){
$con2 = mysql_connect('localhost','root','');
mysql_select_db('esm_quiz', $con2);
$SQL = "SELECT * FROM esm_resultat WHERE code_exp = '$datID' ORDER BY date LIMIT 1,2 ";
$row = mysql_query($SQL, $con2);
echo "nombre de ranger<br/>";
$oldData = $row['q11'];
if ($datCurrent > $oldData){
echo"semaine2 > semaine1<br/>";
echo "".$datCurrent."<br/>";
echo $oldData;
}elseif($datCurrent == $oldData){
echo"semaine2 = semaine1<br/>";
}elseif($datCurrent < $oldData){
echo"semaine2 < semaine1<br/>";
}
}
?>