SkyRanger Posted February 12, 2013 Share Posted February 12, 2013 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 = ""; } Quote Link to comment https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/ Share on other sites More sharing options...
PaulRyan Posted February 12, 2013 Share Posted February 12, 2013 (edited) 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. Edited February 12, 2013 by PaulRyan Quote Link to comment https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/#findComment-1412034 Share on other sites More sharing options...
SkyRanger Posted February 12, 2013 Author Share Posted February 12, 2013 lol, that was way to easy. Guess that is an easy way to do it. Thanks PaulRyan Quote Link to comment https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/#findComment-1412036 Share on other sites More sharing options...
Barand Posted February 12, 2013 Share Posted February 12, 2013 *Edit: I hate the code formatter. You and 135,562 others Quote Link to comment https://forums.phpfreaks.com/topic/274408-mysql-to-mysqli/#findComment-1412040 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.