473,915 Members | 5,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query on MSQL

Im trying to use the mysql_connect command to connect to the mysql
server from a php file.

What is the HOST name I should use?

The tutorial book I have uses "localhost" but Im installing the file
live on the internet, not on a local host machine on pc.

(There are 3 parameters given --- hostname, username, userpassword.).

thank you for any help.

May 16 '06 #1
11 1539
re************* *@yahoo.co.in wrote:
Im trying to use the mysql_connect command to connect to the mysql
server from a php file.

What is the HOST name I should use?


Usually it is localhost. If it is something else, it is something like
server.address. com or 192.168.0.1. But if your service provider didn't
provide you any host address, then it is most likely localhost. If it
isn't, then we have no way knowing what it is and you need to ask that
from your service provider.
May 16 '06 #2
re************* *@yahoo.co.in wrote:
Im trying to use the mysql_connect command to connect to the mysql
server from a php file.

What is the HOST name I should use?


Oh, and in case that wasn't obvious to you, the host name is the address
of the machine where MySQL server is running (as you might know you can
contact to server that is located on another computer than where your
php script is running).
May 16 '06 #3
re************* *@yahoo.co.in wrote:
Im trying to use the mysql_connect command to connect to the mysql
server from a php file.

What is the HOST name I should use?

The tutorial book I have uses "localhost" but Im installing the file
live on the internet, not on a local host machine on pc.


Use the hostname (or IP address) of the host running MySQL.

If MySQL and your PHP scripts run on the same host, you can use the
conventional alias "localhost" .

The alias "localhost" means the same host which is initiating the
connection. Not necessarily the host that is local to _you_.

Regards,
Bill K.
May 16 '06 #4
Thank you.

Ive tried 'localhost' and the address of the web site. The php program
still comes up with message "cant connect to server"

you cant write a meaningfull php program wo access to mysql.

May 16 '06 #5
re************* *@yahoo.co.in wrote:
Im trying to use the mysql_connect command to connect to the mysql
server from a php file.


Are you sure that there even is a mysql server? Where did you find out
that there is one and what the username and password and database name
are for it? The page/mail that claims there is one, should have more
info about what parameters to use to connect it.
May 16 '06 #6
:-0)

well I setup the database myself -- thats kind of how I know the
username password.

Not sure what variable to put for parameter "host".

Much more difficult to work in isolation than as a member of a team.

May 16 '06 #7
re************* *@yahoo.co.in wrote:
Ive tried 'localhost' and the address of the web site. The php program
still comes up with message "cant connect to server"


I agree with Aggro -- find out from whomever manages the server host in
question if MySQL is actually running. This is the first
troubleshooting step.

Regards,
Bill K.
May 16 '06 #8
re************* *@yahoo.co.in wrote:
well I setup the database myself -- thats kind of how I know the
username password.

Not sure what variable to put for parameter "host".


In that case you should know the answer. Is the database server and php
files on the same computer or on two different computers?
May 17 '06 #9
problem sorted. Problem with programming is usually the manual is
arcane, and you can go round and round for hours trying to sort a
simple problem -- easier to get help from your peers :0==)

May 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3441
by: jaysonsch | last post by:
Hello! I am having some problems with a database query that I am trying to do. I am trying to develop a way to search a database for an entry and then edit the existing values. Upon submit, the new values are updated in all corresponding tables (the function of the pages in question). However, on the page that does the DB update, I also want to do some checks on the data before performing the update. Now, the problem that I am...
29
2477
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules" for when and how to use single quotes and double quotes in ASP? thanks! ---------------------- SQL = SQL & "WHERE '" & REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE("GenKTitles.
9
3145
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use SUBSTRING(ProductName, 1, CHARINDEX('(', ProductName)-2). I can get this result, but I had to use several views (totally inefficient). I think this can be done in one efficient/fast query, but I can't think of one. In the case that one query is not...
3
5401
by: Harvey | last post by:
Hi, I try to write an asp query form that lets client search any text-string and display all pages in my web server that contain the text. I have IIS 6.0 on a server 2003. The MSDN site says there is a sample file called Ixtrasp.asp, but I could not find it in my system although I installed indexing service. I followed the steps in MSDN site to create a basic .asp query form (too long to post it here), but it always displays: No...
4
2160
by: Diamondback | last post by:
I have two tables, WIDGETS and VERSIONS. The WIDGETS table has descriptive information about the widgets while the VERSIONS table contains IDs relating to different iterations of those widgets over the years. The idea is that from any widget in the database you can look forward and backward to see different versions of the widget through the years. Here are the tables: WIDGETS widget_id name
2
7519
by: SheryMich | last post by:
Hi - I am having a bit of a problem with the insert into a database. When I go to insert a record into an un-keyed, single table Access database, I get the aforementioned ''Operation Must Use an Updateable Query' error. Points: - The database is in my local temp directory, not inetpub - The directory has read/write permissions - The database has read/write permissions - I created another version of the dbase and tried to reference it...
0
1057
by: anthony | last post by:
Hi. I am attempting to get msql3 installed with php. Using php version php5.1-200604070430 and msql-3.7. I am getting the following error on compile. /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/local/msql3/lib/libmsql.a(libmsql.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/msql3/lib/libmsql.a: could not read...
0
1187
by: MatchSQL | last post by:
When we want to save the database schema and SQL statement , we use the backup of SQLServer provide, but it always content the running data, now a new tool named MatchSQL, it can just save the database you select to a mSQL.mdf file, more easy ! http://www.MatchSQL.com
1
1567
by: ABITECH | last post by:
hi guys I am working on a project in databases using the wamp software. So how do i connect msql to php. Pliz help mi Because i badly nid the code for my project. bye
2
1187
by: chazzy69 | last post by:
Ok this may seem a little strange but what i Im trying to add an altered version of information already stored in my database. Basically i have a colum that has strings of numbers and characters, now i want to have another colum with just the numbers from the other. I have already found out how to remove unwanted characters from strings using php. I know where to add the function into my code cause i already have a cleanup function of...
0
10039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11359
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7259
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5944
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4779
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4346
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3370
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.