DB access inside a usertag with PHP 7
Posted: Tue Oct 04, 2016 7:08 pm
Hi all,
I have written a few usertags which needs access to the database of CMSMS. Up to PHP 5.5 I could easily use
mysql_query("TRUNCATE TABLE `buffertime`");
which works fine. With PHP 7 I need a second parameter:
mysqli_query($link,"TRUNCATE TABLE `buffertime`");
What is a correct, predefined variablename for $link containing the current database?
As a workaround I wrote a function open_db(), which will do the job using mysqli_connect and set $link = open_db().
But that cannot be the solution to the problem. Any hint?
Thanks in advance!
Regards Peter
I have written a few usertags which needs access to the database of CMSMS. Up to PHP 5.5 I could easily use
mysql_query("TRUNCATE TABLE `buffertime`");
which works fine. With PHP 7 I need a second parameter:
mysqli_query($link,"TRUNCATE TABLE `buffertime`");
What is a correct, predefined variablename for $link containing the current database?
As a workaround I wrote a function open_db(), which will do the job using mysqli_connect and set $link = open_db().
But that cannot be the solution to the problem. Any hint?
Thanks in advance!
Regards Peter