Hi all,
I am new to MySQL, although reasonably conversant with PHP. I have always used the internal preview of the Dev-PHP IDE (version 2.0.12) to do the development. Now that I am starting to learn MySQL, I tried to do just a mysql_connect() from within a php script. When I use internal preview, I get the following error message.
Connecting to MySQL @ localhost
PHP Fatal error: Call to undefined function mysql_connect() in C:\.....\test.php on line 10
When I do phpinfo(), I don't see anything about mysql, but I see some reference to SQLite.
Am I supposed to do something additional to be able to connect to mysql from
the IDE ? Or is mysql not usable at all through Dev-PHP ?
Thanks for your help in advance.
B.K.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, your problem is not with Dev-php. All you have to do is configure your web server, php and mysql to work together. I assume you installed mysql, too. It seems you have not configured your php.ini file to use mysql. Find php.ini and delete the comments string ";" from the following lines
extension=php_mysql.dll
extension=php_mysqli.dll
if they are not exist add them to the similar lines (under "Windows Extensions" section ). The php.ini file is under your php installation folder. If the file is not there, rename php.ini-recommended to php.ini and edit the mentioned lines.
Then check phpinfo()again, if you see mysql section. Don' forget to restart your server after changes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks keenblade, I had to just uncomment the mysql.dll line under Winodows extensions. Now I can connect to mysql. I am planning to only develop/debug
here (for learning sake) and deploy on a webserver somewhere else. Are there
any important issues I should know about (such as a discrepancy of behavior
the code in preview vs. the behavior on a real webserver) ? Is there a place
for this kind of documentation ?
Thank you again.
b.k.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I am new to MySQL, although reasonably conversant with PHP. I have always used the internal preview of the Dev-PHP IDE (version 2.0.12) to do the development. Now that I am starting to learn MySQL, I tried to do just a mysql_connect() from within a php script. When I use internal preview, I get the following error message.
Connecting to MySQL @ localhost
PHP Fatal error: Call to undefined function mysql_connect() in C:\.....\test.php on line 10
When I do phpinfo(), I don't see anything about mysql, but I see some reference to SQLite.
Am I supposed to do something additional to be able to connect to mysql from
the IDE ? Or is mysql not usable at all through Dev-PHP ?
Thanks for your help in advance.
B.K.
Hi, your problem is not with Dev-php. All you have to do is configure your web server, php and mysql to work together. I assume you installed mysql, too. It seems you have not configured your php.ini file to use mysql. Find php.ini and delete the comments string ";" from the following lines
extension=php_mysql.dll
extension=php_mysqli.dll
if they are not exist add them to the similar lines (under "Windows Extensions" section ). The php.ini file is under your php installation folder. If the file is not there, rename php.ini-recommended to php.ini and edit the mentioned lines.
Then check phpinfo()again, if you see mysql section. Don' forget to restart your server after changes.
Thanks keenblade, I had to just uncomment the mysql.dll line under Winodows extensions. Now I can connect to mysql. I am planning to only develop/debug
here (for learning sake) and deploy on a webserver somewhere else. Are there
any important issues I should know about (such as a discrepancy of behavior
the code in preview vs. the behavior on a real webserver) ? Is there a place
for this kind of documentation ?
Thank you again.
b.k.
Hi,
> Is there a place for this kind of documentation ?
May I suggest that this forum seems an excellent place ?
Regards,
Pierre.
Excellent support. Thanks again, Keenblade !
Best regards,
Pierre.