Error after php 5 to 7 upgrade

after I switched site to php 7 with code igniter frame work folowing code refuse to work .
can some one guide me please

<?php $query="SELECT * FROM xxxxxxxxxxx ORDER BY cswdate ASC";$result=mysql_query($query); $num=mysql_num_rows($result); echo "

"; $i=0;while ($i < $num) {$NAME=mysql_result($result,$i,"NAME"); $PHONE=mysql_result($result,$i,"PHONE"); $DATE=mysql_result($result,$i,"DATE"); $feedbackI=mysql_result($result,$i,"ID"); $pms=mysql_result($result,$i,"pms"); echo " $feedbackI $NAME $PHONE $pms $DATE "; $i++;}?> <?php $query="SELECT * FROM users WHERE status != 'archived' AND caseNumber = 'CTW' OR status != 'archived' AND caseNumber = 'CTWN' ORDER BY next_visit_date ASC";$result=mysql_query($query); $num=mysql_num_rows($result); echo "

"; $i=0;while ($i < $num) {$patitName=mysql_result($result,$i,"firstname"); $cswdate=mysql_result($result,$i,"next_visit_date"); $feedbackI=mysql_result($result,$i,"id"); echo " "; $i++;}?>


PMS CASES Case working date

$patitName $cswdate
<?php $query="SELECT * FROM XXXXXX WHERE last_activity < next_visit_date AND status != 'archived' AND caseNumber != 'CTW' AND caseNumber != 'CTWN' ORDER BY next_visit_date ASC";$result=mysql_query($query); mysql_close(); $num=mysql_num_rows($result); echo "

"; $i=0;while ($i < $num) {$patitName=mysql_result($result,$i,"firstname"); $cswdate=mysql_result($result,$i,"next_visit_date"); $feedbackI=mysql_result($result,$i,"id"); $Caseno=mysql_result($result,$i,"caseNumber"); echo " "; $i++;}?>


CASES WAITING FOR FOLLOWUP

$patitName $Caseno $cswdate

You are using obsolete mysql_* code that has been completely removed from Php. You need to use PDO or at the least Mysqli.

1 Like

As to the documentation, Codeigniter seems to have a database abstraction based on models that you also can use

https://www.codeigniter.com/user_guide/general/models.html

Yes you are correct sir
I tried changing it to mysqli Unfortunate i was not ablle to do the coding as the code do not have mysqili connect !!

Also the data base extaction method did not work in this page
I am not able to understand the solution

Sponsor our Newsletter | Privacy Policy | Terms of Service