473,605 Members | 2,734 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 1516
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
3425
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
3120
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
5380
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
2142
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
7507
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
1047
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
1178
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
1558
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
1175
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
7934
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8415
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
8069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8286
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6742
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5886
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...
1
2438
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
1
1537
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1270
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.