table name: qupdate
filed: last_update
Expand|Select|Wrap|Line Numbers
- $sql4="SELECT * FROM qupdate";
- $result4=mysql_query($sql4);
- $last_update=mysql_result($result4,"last_update");
on this line,
Expand|Select|Wrap|Line Numbers
- $last_update=mysql_result($result,"last_update");
Expand|Select|Wrap|Line Numbers
- if($last_update==$today)
- {
- $cqid=mysql_result($result,"cqid");
- $update1="update cquestions set showdate='$tomorrow' where showdate='0000-00-00' and cqid!='$cqid' order by cqid limit 2";
- mysql_query($update1);
- }
when I uploaded the code on the web server, (PHP Version 5.5.18) I am getting this warning and the following code not executing.
full code:
Expand|Select|Wrap|Line Numbers
- <?php
- $today=date("Y-m-d");
- mysql_query("SET CHARACTER SET utf8");
- echo "<form method='post' id='submit' action='checkresult2.php'>";
- $sql="SELECT * FROM cquestions where showdate='$today' limit 1,1";
- $result=mysql_query($sql);
- while ($row = mysql_fetch_array($result)) {
- echo "<p>" . $row['cqtext'] . "</p>";
- $sql2="SELECT * FROM canswers where cqid=".$row['cqid'];
- $result2=mysql_query($sql2);
- while($row2=mysql_fetch_assoc($result2))
- {
- echo "<input type='radio' name='".$row['cqid']."' value='".$row2['cqans']."' />".$row2['aatext'];
- echo"<br>";
- }
- }
- $tomorrow= date("Y-m-d", strtotime("tomorrow"));
- $sql4="SELECT * FROM qupdate";
- $result4=mysql_query($sql4);
- $last_update=mysql_result($result4,"last_update");
- if($last_update==$today)
- {
- $cqid=mysql_result($result,"cqid");
- $update1="update cquestions set showdate='$tomorrow' where showdate='0000-00-00' and cqid!='$cqid' order by cqid limit 2";
- mysql_query($update1);
- $update2="update qupdate set last_update='$tomorrow'";
- mysql_query($update2);
- $sql3="SELECT * FROM qupdate";
- $result3=mysql_query($sql3);
- $last_update=mysql_result($result3,"last_update");
- }
- echo"<br>";
- echo"<br>";
- echo "<div align='left' style='padding-left:160px;'>";
- echo"<input type='submit' id='submit' name='submit' value='التالي' />";
- echo "</div>";
- echo "</form>" ;
- ?>