Mysql_query() function Error |
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 (05-22-2019, 01:41 PM)Mekaboo Wrote: Hello all! 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! (05-22-2019, 03:04 PM)noobie Wrote:(05-22-2019, 01:41 PM)Mekaboo Wrote: Hello all! That was changed in my database.php file. I may have to take your advice and cut the code out. Thank you so very much
When using all MySQLi calls they are mysqli_method
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(05-22-2019, 04:52 PM)Mekaboo Wrote:(05-22-2019, 03:04 PM)noobie Wrote:(05-22-2019, 01:41 PM)Mekaboo Wrote: Hello all! (05-24-2019, 08:50 AM)MAILITY Wrote:Got it caught, thank you(05-22-2019, 04:52 PM)Mekaboo Wrote:(05-22-2019, 03:04 PM)noobie Wrote:(05-22-2019, 01:41 PM)Mekaboo Wrote: Hello all! |
Welcome Guest, Not a member yet? Register Sign In |