i use freehostia and my server is dedicated. ive also enabled the mysql remote access in my server machine and ive opened the ports 80 and 8000.
i just hope somebody is going to answer because i know there are only a few people really willing to help newbies. so im almost sure the only post in this topic will be mine.
You cant use return because it can be used in function only and $res will return an object if successfully connected to mysql server on fail will return false.
take a look on this http://php.net/mysql_connect
and try this
<?php $db_user = "root"; $db_pass = "my password here"; $db_name = "l2jdb"; $db_serv = "my ip here"; $res = mysql_connect ($db_serv, $db_user, $db_pass); $resdb = mysql_select_db ($db_name, $res); if (!$res || !$resdb) die(mysql_error());?>
if you use root user it will not work because it is limited to work on localhost you need to create a new user and give him access to connect from remote ip i think thats your problem.
CREATE USER 'myname'@'remote.server.address' IDENTIFIED BY 'mypass';GRANT ALL PRIVILEGES ON l2jdb.* to 'myname'@'remote.server.address';FLUSH PRIVILEGES;