Current location: Hot Scripts Forums » Programming Languages » PHP » this should be an easy questions for you experienced ppl plz help me with this....


this should be an easy questions for you experienced ppl plz help me with this....

Reply
  #1 (permalink)  
Old 05-29-04, 09:40 AM
johny johny is offline
Newbie Coder
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy this should be an easy questions for you experienced ppl plz help me with this....

ok i need to know what a local host is plz i thanks you for your help
Reply With Quote
  #2 (permalink)  
Old 05-29-04, 09:46 AM
krmoon krmoon is offline
Newbie Coder
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by johny
ok i need to know what a local host is plz i thanks you for your help
"localhost" is the host name of your mysql datase....

localhost means that mysql is being hosted locally...basically you downloaded mysql and set it up on your computer at home....

if you are trying to login or connect just leave localhost set as "localhost"...

if your database is hosted from another server you will need to get in touch with the administrator and ask them what the host name is....

I hope this helps...it's kind of hard to explain
Reply With Quote
  #3 (permalink)  
Old 05-29-04, 09:50 AM
johny johny is offline
Newbie Coder
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
oh

oh ok becaus ei am making a signup script but i had to make a db config script to put in the signup to make a connection to the database but i need to know the local host do you know any other way to acheive this and thanks for the help
Reply With Quote
  #4 (permalink)  
Old 05-29-04, 09:54 AM
johny johny is offline
Newbie Coder
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
and..

and what would the mysql server host
Reply With Quote
  #5 (permalink)  
Old 05-29-04, 09:58 AM
krmoon krmoon is offline
Newbie Coder
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by johny
and what would the mysql server host
is your mysql database set up on your personal computer?

if it is the the "mysql server host" would be "localhost"....

what does your connection string look like without your password included?
Reply With Quote
  #6 (permalink)  
Old 05-29-04, 01:22 PM
johny johny is offline
Newbie Coder
 
Join Date: May 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
heres an answer

i am being hosted by hammyhosting and the database is userinfo
and here is the script i use to make the connection:


<?
// Replace the variable values below
// with your specific database information.
$host = "localhost";
$user = "drago";
$pass = "password";
$db = "drago_userinfo";

// This part sets up a persistant connection to the
// database (so you don't need to reopen the connection
// elsewhere on the same page).
$ms = mysql_pconnect($www.hammyhosting.com, $drago, $password);
if ( !$ms )
{
echo "Error connecting to database.\n";
}

// Then you need to make sure the database you want
// is selected.
mysql_select_db($userinfo);
?>

so the coomand is $ms = mysql_pconnect($host, $user, $pass);

but it says

Warning: mysql_pconnect(): Unknown MySQL Server Host 'hammyhostingcom' (1) in /home/drago/public_html/dbconfig.php on line 12
Error connecting to database.


please help
Reply With Quote
  #7 (permalink)  
Old 05-29-04, 01:46 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
change this line :
PHP Code:

$ms mysql_pconnect($[url]www.hammyhosting.com[/url], $drago$password); 

to:
PHP Code:

$ms mysql_pconnect($host$drago$password); 

__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 10:36 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.