NameSilo

Why won't this work??

Spacemail by SpaceshipSpacemail by Spaceship
Watch

Barrucadu

Established Member
Impact
64
myfileminder.com/articles/dbconnect.php
PHP:
$server="---server---";
$user="---username---";
$pass="---password---";
$database="---database---";
$sql="---query---";

webmaster.php
PHP:
include 'http://www.myfileminder.com/articles/dbconnect.php';	 
mysql_connect($server,$user,$pass) or die("Could not connect to database: " . mysql_error());
mysql_select_db($database) or die("Could not select the database: " . mysql_error());
$result=mysql_query($sql) or die("Could not query the database: " . mysql_error());
mysql_close();

When I run it I get the error
Code:
Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in e:\domains\m\myfileminder.com\user\htdocs\articles\webmaster.php on line 16

line 16 is this:
PHP:
mysql_connect($server,$user,$pass) or die("Could not connect to database: " . mysql_error());

but I cant find the problem.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Code:
include 'http://www.myfileminder.com/articles/dbconnect.php';

you cant do that if you are on a different server/ip

do this:
Code:
include 'dbconnect.php';
 
0
•••
hmm... thing is I want that script to work on other peoples sites, its an article script I'm working on, thats the script webmasters use to display the articles...
 
0
•••
you're going to have to provide the username/pass/ip as a feed then parse it out since you're doing it remotely. Or you could also just provide the info that they're going to put on their site as a feed then you wouldnt need the whole connection issue.
 
0
•••
provide the info that they're going to put on their site as a feed

how the hell would I do that?
 
0
•••
You may want to research what a feed does..
basically you print all the info on a page, and then you write your script to goto your site and parse the info from that page.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back