Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsZymic Free Web HostingDatabases & MySQL right
  Reply to this topic Start new topic
left right
soumya_bbso
post May 2 2009, 06:06 AM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 2-May 09
Member No.: 93,440



It looks like its not able to connect to sql server as localhost, I'm getting this error,

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'locahost' (1) in /www/uuuq.com/i/t/s/itsblueberry/htdocs/connect.php on line 5
Could not connect.



database name - localhost
username - <db_username>
password - <db_password>

below is the code

<?php

$db = mysql_connect("locahost", "<**db_username**>", "<**db_password**>") or die("Could not connect.");

if(!$db)

die("no db");

if(!mysql_select_db("<**dbname**>",$db))

die("No database selected.");

if(!get_magic_quotes_gpc())

{

$_GET = array_map('mysql_real_escape_string', $_GET);

$_POST = array_map('mysql_real_escape_string', $_POST);

$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

}

else

{

$_GET = array_map('stripslashes', $_GET);

$_POST = array_map('stripslashes', $_POST);

$_COOKIE = array_map('stripslashes', $_COOKIE);

$_GET = array_map('mysql_real_escape_string', $_GET);

$_POST = array_map('mysql_real_escape_string', $_POST);

$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);

}



?>
Go to the top of the page 
 
  + Quote Post
soumya_bbso
post May 2 2009, 06:29 AM
Post #2


Newbie
*

Group: Members
Posts: 2
Joined: 2-May 09
Member No.: 93,440



I got the answer, there was a minor spelling mistake in the username, it got unnoticed, i fixed it everything looks goodnow

the Flash guest book is available at http://itsblueberry.uuuq.com
Go to the top of the page 
 
  + Quote Post
 Reply to this topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 21st November 2009 - 11:13 AM