CodeIgniter Forums
Is MySQL access possible when running the PHP server? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Is MySQL access possible when running the PHP server? (/showthread.php?tid=61572)



Is MySQL access possible when running the PHP server? - n2fole00 - 04-27-2015

Hi, I'm developing locally, and am running CI from php -S localhost:8000

I also have MySQL installed with phpMyAdmin running on localhost/phpmyadmin

I created a db, table and simple id and message columns, entered a couple of rows of data and tried to pull them out into a CI view.

Quote:A Database Error Occurred

Error Number: 1146

Table 'ci_test.messages' doesn't exist

SELECT * FROM `messages`

Filename: models/Test_model.php

Line Number: 15


This is line 15
PHP Code:
$query $this->db->get('messages'); 

But before I output all my MVC and DB config code, I was wondering if it is even possible to interface with MySQL running on the built in PHP server?

Thanks.


RE: Is MySQL access possible when running the PHP server? - CroNiX - 04-27-2015

You might try setting the ip instead of using "localhost" for your db connection.


RE: Is MySQL access possible when running the PHP server? - n2fole00 - 04-27-2015

Ok, it appears I had a problem in my model. I accidentally called the column instead of table.