Kahuki Webmaster Forum  

Go Back   Kahuki Webmaster Forum > Website Development & Management > Programming > PHP

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-07-2007, 02:05 PM
Member
 
Join Date: Jun 2007
Posts: 56
Gwildor is on a distinguished road
In PHP,In mysql function mysql_connect('localhost','root','') what 'localhost','root','', stand for

In mysql function mysql_connect('localhost','root','') what 'localhost','root','', stand for and are they specific words? and why third field is kept blank?
what is addslashes function in PHP?

Reply With Quote
  #2 (permalink)  
Old 06-07-2007, 02:14 PM
Rookie
 
Join Date: Jul 2007
Posts: 5
daRite is on a distinguished road
Localhost means the database is held on the same server as the webpage
root is the username of the database user
'' the blank is the password for that user

Reply With Quote
  #3 (permalink)  
Old 06-07-2007, 02:14 PM
Decard's Avatar
Member
 
Join Date: May 2006
Posts: 64
Decard is on a distinguished road
hm,
When you connect to your database,
you'll use the function mysql_connect(hostlocation, username, password);

the reason why you use localhost, is because your php-page is located on the same machine where the mysql-server is hosted, en root means you are running as superuser,
whith standardconfiguration, the superuser has no password, so that's why you leave the third blank.
It's best that you make a new user in your database, so when you fuck it up, you won't destory all your other data.

The addslashes function, adds quotes to a string

any other questions: mail me

Reply With Quote
  #4 (permalink)  
Old 07-29-2007, 07:07 PM
Rookie
 
Join Date: Jul 2007
Posts: 23
anow2 is on a distinguished road
Send a message via MSN to anow2
I know on some hosts, they won't let you use localhost (Dreamhost).

If thats your case, just point it to your mysql directory (For me its mysql.---soft.org)

Reply With Quote
  #5 (permalink)  
Old 10-30-2007, 02:00 PM
Rookie
 
Join Date: Oct 2007
Posts: 16
jonimontana is on a distinguished road
$host = 'localhost';
$dbuser = 'user';
$pass = 'pass';

mysql_connect($host,$user,$pass);

you just not have pass in your db coz your using easyphp\wamp.

__________________
JoniMontana - Programmer
icq-50015047
  • Php
  • Html
  • Sql

Reply With Quote
Reply

Bookmarks

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: mysql_pconnect() [function.mysql-pconnect]...? TheDumbGamer PHP 2 08-14-2007 12:48 PM
MySQL Connections Outside of Localhost? taffman PHP 3 09-20-2006 07:26 PM
MySQL Query SUM() function (in PHP)? diggme PHP 3 07-28-2006 07:15 AM
Why is BBQ called BBQ; and what does Bar Be Que stand for and who made is Acronym? M.K.A. General Discussions 2 06-28-2006 05:07 PM
what does MTV stand for in MTV.com? dire strait General Discussions 4 06-01-2006 11:45 PM


All times are GMT. The time now is 05:13 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0