I have a script in kohana which runs fine on php 5.2.11. I took out a line for mysql_select_tables using a mysql_query. When I put it on a php 5.3 server, I get the following errors:
Warning Message
An error was detected which prevented the loading of this page. If this problem persists, please contact the website administrator.
system/libraries/drivers/Database/Mysql.php [483]:
mysql_data_seek() expects parameter 2 to be long, string given
Stack Trace
system/libraries/drivers/Database/Mysql.php [483]:
mysql_data_seek( Resource id #39, mysql_fetch_array )
system/libraries/drivers/Database.php [558]:
Mysql_Result->seek( mysql_fetch_array )
application/views/right_menu.php [33]:
Database_Result->offsetGet( mysql_fetch_array )
system/libraries/Controller.php [74]:
include( application/views/right_menu.php )
I wonder if this is a seperate issue concerning php 5.2 vs. 5.3, or a result of replacing mysql_list_tables with a mysql_query(“SHOW TABLES…”)? It seems to be a problem with a string called mysql_fetch_array being sent to mysql_data_seek for the second parameter instead of a long, although this works in 5.2. Thanks.
The following function has been deprecated in 5.3 Please see the manual for other alternative https://www.php.net/manual/en/function.mysql-list-tables.php
According to php manual "This function is deprecated. It is preferable to use mysql_query() to issue an SQL SHOW TABLES [FROM db_name] [LIKE ‘pattern’] statement instead"