Jump to content

mysql to mysqli


SkyRanger

Recommended Posts

Hello, I am converting an old code from mysql to mysqli and having some problems. Not sure how I would go about changing this over:

 

               if (mysql_num_rows($chkEvent_res) > 0) {
                       $event_title = "<br/>";
                       while ($ev = mysql_fetch_array($chkEvent_res)) {
                               $event_title .= "".stripslashes($ev["event_title"])."<br/>";
                       }
                       mysql_free_result($chkEvent_res);
               } else {
                       $event_title = "";
               }

Link to comment
https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/
Share on other sites

if (mysqli_num_rows($chkEvent_res) > 0) {
$event_title = "<br/>";
while ($ev = mysqli_fetch_array($chkEvent_res)) {
$event_title .= "".stripslashes($ev["event_title"])."<br/>";
}
mysqli_free_result($chkEvent_res);
} else {
$event_title = "";
}

 

*Edit: I hate the code formatter.

Link to comment
https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/#findComment-1412034
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.