I'm using the following code from a tutorial trying to connect to a database but am getting an http 500 error.
$dbconn = mysql_connect("localhost","phpuser","!phpuser");
if (!$dbconn) {
die('Could not connect: ' . mysql_error());
}
mysql_query("SET NAMES 'utf8'");
http://www.netbeans.org/kb/docs/php/wis ... sson2.html
The link above is to the tutorial I'm working with.
Any ideas are appreciated.
connecting to db
Moderator: General Moderators
-
sujithtomy
- Forum Commoner
- Posts: 46
- Joined: Tue Mar 24, 2009 4:43 am
Re: connecting to db
Hello,
is MySql Module installed in your PHP ??
check with
to see mysql installed and version.
is MySql Module installed in your PHP ??
check with
Code: Select all
echo phpinfo();Re: connecting to db
where within the phpinfo will I see the mysql installed and version info.
I've ran the phpinfo but do not see mysql installed or version info.
I've ran the phpinfo but do not see mysql installed or version info.
-
sujithtomy
- Forum Commoner
- Posts: 46
- Joined: Tue Mar 24, 2009 4:43 am
Re: connecting to db
- Attachments
-
- info_php.jpg (37.11 KiB) Viewed 476 times
Re: connecting to db
Okay....I knew I had installed mySQL but was not seeing the version info in the output of phpinfo();
I ran the PHP install again this time selecting the option for mySQL extension and all is working. I had previously tried re-running the PHP install but I selected full install (all options) and that created a problem.
Bottom line is that when running the install I pretty much accepted defaults with the exception of the extension for mySQL.
Richard
I ran the PHP install again this time selecting the option for mySQL extension and all is working. I had previously tried re-running the PHP install but I selected full install (all options) and that created a problem.
Bottom line is that when running the install I pretty much accepted defaults with the exception of the extension for mySQL.
Richard