(05-22-2019, 01:41 PM)Mekaboo Wrote: Hello all!
Im getting this error and trying to fix it:
An uncaught Exception was encountered
Type: Error
Message: Call to undefined function mysql_query()
Filename: /home4/cultured/public_html/application/views/dashboard.php
Line Number: 332
Its from this line of code:
$mysql=mysql_query("select * from messages order by msg_id desc");
Im connected to DB (include("application/config/database.php")); and upgraded within webhost from 5.4 to 7.0 php but still get this error. I feel that I suppose to add the table (citable) that I made within the database but not sure. How to correct this if possible?
,
Mekaboo
You are using the deprecated
mysql_query function... (which is removed as of PHP 7.0)
Either you're using
mysql_query manually in your script (which means your issue is not related to CI and you should read about MySQLi or PDO)
or you're using an ancient script which was set to use
mysql, in that case:
Go to application => config => database.php and change from
PHP Code:
$db['default']['dbdriver'] = 'mysql';
to
PHP Code:
$db['default']['dbdriver'] = 'mysqli';
Not sure if your script can be trusted anymore in production even after this change!