Mysql/php connection

Joyal

I'm a newbie to ubuntu,and im trying to connect the mysqlworkbench(database) with php5.3

if (function_exists('mysql_connect')) {
 echo "Good<br />\n";
} else {
echo "Bad.<br />\n";
}

I'm getting the output as Bad and then i tried with mysqli_connect ,that is also not exists in my scenario. Is there any way to solve this issue?

Thanks in Advance.. show some examples to tackle this

gertvdijk

I'm assuming you've installed PHP and MySQL using regular Ubuntu packages. Then install the php5-mysql package to have MySQL bindings for PHP. E.g.

sudo apt-get install php5-mysql

You may need to restart your web server to make the changes effective.

Verify with a simple phpinfo PHP file the PHP-MySQL support (mysqli extension).

<?php

phpinfo();

?>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사