Help - Search - Members - Calendar
Full Version: Local Host?
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
MaKo
I'm trting to activate the wTag v1.0 shoutbox, and i'm stuck at the install section.
I need to insert the following details:
$dbhost = "localhost";
$dbuser = "username";
$dbpass = "password";
$dbname = "databasename";
all I need is the local host - what is it?
NaRzY
It is localhost. Leave that option as it is.

Jacob.
bebenz
btw,
i wrote script like this

<?
$koneksi="mysql_connect("localhost","mcolor_master","xxxxxx");
...
...
..
...


?>

is that true for connecting to my database????

NaRzY
I do not what the (...) mean so I will just answer what I can.
CODE
<?php
mysql_connect("localhost", "user", "password") or die(mysql_error());
echo "Connected to MySQL<br />";
?>

In the above code, we are establishing a connection to MySQL and dispalying a nice friendly message to tell us we have a connection.

CODE
<?php
mysql_connect("localhost", "user", "password") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>

However, in this piece of code, we are connecting to MySQL AND a Database. This is needed if your application requires a database to be present.

Hope this helps.

Jacob.
electric_master
QUOTE(NaRzY @ Jul 21 2009, 12:39 PM) *
I do not what the (...) mean so I will just answer what I can.
CODE
code

In the above code, we are establishing a connection to MySQL and dispalying a nice friendly message to tell us we have a connection.

CODE
code

However, in this piece of code, we are connecting to MySQL AND a Database. This is needed if your application requires a database to be present.

Hope this helps.

Jacob.


I would suggest doing it like this:
CODE
<?php
$con = mySQL_connect("localhost","user","password");
if(!$con){
die('Could not connect:' .mySQL_error()};
else{
// Your code here
}
mySQL_close($con);


That way you can close it easier. smile.gif
bebenz
thanks jacob...

(...) in my question, mean the code...hehe


i don't know where the problem..

im making simple guestbook...
but i think,, it didnt connected to database,,because when i try to input some data,, it didn't work at all..
please check my guestbook..
here's the URL
http://mcolor.vndv.com
i need someone who mastering php n mysql..
because im a begineer...
smile.gif


thanks...

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.