Client Support Community Server Status Contact Us Client Login
Email Hosting Website Hosting Reseller Hosting VPS Hosting Dedicated Servers

    Join our Community      Check your private messages       Profile       Search       FAQ       Memberlist       Log in


Database connect

 
Post new topic   Reply to topic    NetHosted Community Index -> FTP/SQL Support
paulmarson Reply with quote
 NetHosted Customer

 

 Joined: 26 Jan 2005
 Posts: 439
 Location: Midlands

PostPosted: Mon Mar 14, 2005 10:04 pm    Post subject: Database connect
 
Hello ! tis me again !
long time no hastle eh ! lol

When i put the connection string and stuff into my webpage, i get no connection to the datebase, all i get is the connection string apearing as text.

HELP ME !!!!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
NetHosted - Andrew Reply with quote
 NetHosted Staff

 

 Joined: 22 Mar 2004
 Posts: 5684
 

PostPosted: Tue Mar 15, 2005 12:03 pm    Post subject:
 
Ummm, not quite sure of your question, can you elaborate?

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think  of NetHosted!
Back to top
View user's profile Send private message
rhinoian Reply with quote
 Community Liason

 

 Joined: 25 Nov 2004
 Posts: 631
 Location: Manchester

PostPosted: Tue Mar 15, 2005 1:29 pm    Post subject:
 
If you are using php have you remembered to start with <? tag? Perhaps if you post some code, we can have a look.
_________________
Hard to find and premium pet products at Pennine Vets 
Back to top
View user's profile Send private message Visit poster's website
paulmarson Reply with quote
 NetHosted Customer

 

 Joined: 26 Jan 2005
 Posts: 439
 Location: Midlands

PostPosted: Tue Mar 15, 2005 1:51 pm    Post subject: Database connection
 
According to cpanel the connection string is
$dbh=mysql_connect ("localhost", "thedrug_paul", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("thedrug_business");

When i put this code into a webpage i am getting no connection, but the code is apearing as if i have asked it to echo on screen
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
NetHosted - Andrew Reply with quote
 NetHosted Staff

 

 Joined: 22 Mar 2004
 Posts: 5684
 

PostPosted: Tue Mar 15, 2005 2:14 pm    Post subject:
 
Did you put the password where it says "<PASSWORD HERE>" ?

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think  of NetHosted!
Back to top
View user's profile Send private message
rhinoian Reply with quote
 Community Liason

 

 Joined: 25 Nov 2004
 Posts: 631
 Location: Manchester

PostPosted: Tue Mar 15, 2005 2:23 pm    Post subject:
 
Andrew, does localhost work on your server?
_________________
Hard to find and premium pet products at Pennine Vets 
Back to top
View user's profile Send private message Visit poster's website
NetHosted - Andrew Reply with quote
 NetHosted Staff

 

 Joined: 22 Mar 2004
 Posts: 5684
 

PostPosted: Tue Mar 15, 2005 2:27 pm    Post subject:
 
If he's uploading the files to our server yes, obviously wont work when on his home computer...

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think  of NetHosted!
Back to top
View user's profile Send private message
paulmarson Reply with quote
 NetHosted Customer

 

 Joined: 26 Jan 2005
 Posts: 439
 Location: Midlands

PostPosted: Tue Mar 15, 2005 2:27 pm    Post subject:
 
Yep, put the password in.

its coming up just as text in the page, just as if i want the details for others to read
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
NetHosted - Andrew Reply with quote
 NetHosted Staff

 

 Joined: 22 Mar 2004
 Posts: 5684
 

PostPosted: Tue Mar 15, 2005 2:40 pm    Post subject:
 
Is your page a .php page?

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think  of NetHosted!
Back to top
View user's profile Send private message
paulmarson Reply with quote
 NetHosted Customer

 

 Joined: 26 Jan 2005
 Posts: 439
 Location: Midlands

PostPosted: Tue Mar 15, 2005 2:48 pm    Post subject:
 
Yep, what I will do, when i get home i will re write the page in notepad and try it again.

Back to top
View user's profile Send private message Visit poster's website MSN Messenger
NetHosted - Andrew Reply with quote
 NetHosted Staff

 

 Joined: 22 Mar 2004
 Posts: 5684
 

PostPosted: Tue Mar 15, 2005 3:02 pm    Post subject:
 
I'm sure it's something obvious, I'll look into this!

Andrew

_________________
| Andrew Bassett
| Managing Director, NetHosted Ltd.
| Resellers, take a look at overselling !
| Members, tell us what you think  of NetHosted!
Back to top
View user's profile Send private message
rhinoian Reply with quote
 Community Liason

 

 Joined: 25 Nov 2004
 Posts: 631
 Location: Manchester

PostPosted: Tue Mar 15, 2005 3:09 pm    Post subject:
 
If it is echoing the text rather than running the query, there must be a php error else the mysql_error() would be returned. Maybe some code hasn't be closed properly before this line. If you are printing text before this line, have you closed the command properly?
_________________
Hard to find and premium pet products at Pennine Vets 
Back to top
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    NetHosted Community Index -> FTP/SQL Support
Page 1 of 1

User Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

 
Jump to: