DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2009-01-27 03:55:03

Credo
Member
Registered: 2009-01-26
Posts: 17

Unable to connect to mysql through php

Quick problem with setup, and I can't find the problem.  I've got lighttpd installed.  php is working - the info is displayed when posting a page with phpinfo();.  I also have Mysql set up and running.  I can connect to the database, and perform queries.  However, I followed all instructions at http://nas-tweaks.net/CH3SNAS:Tutorials but when I create a page with the following code:

Code:

<?php
// Connect to the database
$link = mysql_connect("localhost", "root","not for your eyes");
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';

// Select the database "mysql"
mysql_select_db("mysql");

// Query the database for the Users:
$result = mysql_query("SELECT Host, User, Password FROM user;");

// Print the results
while($row = mysql_fetch_object($result))
{
    echo $row->User . "@" . $row->Host . " has the encrypted password: " . $row->Password;
}

// Close the connection to the database
mysql_close($link);
?>

I get nothing!  the page is blank.  I ran this on my windows machine, and it works fine!  Anyone have any suggestions?

I've enabled mysql.so in the php.ini configuration I've followed all the steps!!!   ARGH!

Any help would be appreciated!

Thanks in advance!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB