How do I Connect a website in MySql?
Published: July 5, 2009

Question:
How do I Connect a website in MySql?

Answer:
If you want to connect your website to a MySQL database. There are a number of steps.

  1. You must make sure your hosting company offers that service and that you have that feature on your current hosting account.
  2. You must create the database with a user name and password. You can manipulate your database(s) using a program called phpMyAdmin. This is usually provided by your host company.
  3. Youmust use a scripting language to connect with. Usually of you are using MySQL then the language will be PHP.
  4. You then create the php page and upload it up to your sever.
  5. The following sample will allow you to connect your php page to the database. It does NOT do anything else other than connect. There are too many other variables on the type of table created and what you may want to do to show a general example.

Example:
<?php

//Usually this is localhost. But could be an address of the database server
$HostType = "locahost";

//Name of your database
$DatabaseName = "SomeName";

//Your database username
$DbaseUsername = "SomeUsername";

//Your database password
$DbasePassword = "SomePassword";

$db=mysql_connect($HostType,$DbaseUsername,$DbasePassword);
mysql_select_db($DatabaseName,$db) or die ("cant change");


//code to manipulate the data base

?>

About the Author
Rich Agnew is an author for The Computer Geek Custom Web Page Design. The Computer Geek is a web design company that prides itself in professional service at a fraction of the cost. The Computer Geek specializes in Custom Web Design, PHP & MySql and Ecommerce.

Customer Reviews:

We discovered an issue with our Oscommerce cart pr
We discovered an issue with our Oscommerce cart processing images. It is about 14 years old and heavily modified. Looking on google for some expert help I found Rich and reached out to him. We received a response the same day. The next day his team was working on our issue and was able to solve it within a few hours. Price was reasonable and we are very appreciative to find a competent and professional oscommerce expert to help successfully troubleshoot our issue.
Phillip Sirota
Published:
Phillip Sirota
psirota@yahoo.com
I'm very new to the whole idea of having a website
I'm very new to the whole idea of having a website / blog. I used Bluehost.com and WordPress.org to create Thepredatorhunter.com and then managed to wreck it. On a Sunday morning I opened chat box with Rich and within a few hours everything was fantastic! This isn't just a company for big biz, if your new and small, The Computer Geek can help you out. In trouble? Stop fretting and start typing in the chat box. You will be glad you did!
Dennis Gilmore
Published:
Dennis Gilmore
dgilmore@basthatfield.com
"I worked with Rich because my website was not wor
"I worked with Rich because my website was not working due to being old and out dated. Rich explained to me the cause of the problems and gave me different options to fix the problems. Rich was able to get my website up and running very quickly and would not even charge me! I am so impressed with Rich's honesty. When it comes time I will be calling on Rich to update my site. He has earned a loyal customer. Thanks Rich!!"
Jason Knuth
Published:
Jason Knuth
jknuth1@wi.rr.com
"WOW! I didn't expect my service request to be han
"WOW! I didn't expect my service request to be handled so quickly. I reached out to Rich for a quote to help migrate my WordPress website and heard back from him within hours. He called me to discuss and was super friendly and straight to the point. I couldn't have asked for better service. Computer Geek will definitely be my go-to for all website and IT needs! Thank you!!"
BrittneyGage
Published:
BrittneyGage
brittneyrosegage@gmail.com
I want to commend you on the brilliance of the wor
I want to commend you on the brilliance of the work Computer-Geek has accomplished for expHand Inc. During certain website issues, the company experienced that had the company website taken down through no fault of the company. After Google did not offer the assistance to reload the website, the work Computer-Geek undertook to have the expHand Inc. website updated and reinstalled was remarkable. I would suggest to any company looking for website assistance from development to rectifying big and small problems that they should contact Computer-Geek. The personal attention given to expHand by Rich did not leave anything to chance. He worked with us as if he was a treasured employee of long-standing. How Computer-Geek continues to be of assistance delivers a continuous piece of mind. expHand will be a client for life. All the best,
Frank Nemirofsky
Published:
Frank Nemirofsky
Frank@SafestPeople.com
If you're looking for a Joomla expert, look no fur
If you're looking for a Joomla expert, look no further. We hired The Computer Geek to migrate our Joomla site last summer. The move was smooth and successful with no down time at all. I've contacted Rich with various web development issues since then and he's always found the solution. Exceptional service at competitive prices.
Brenden Wright
Published:
Brenden Wright
brendenwright0@gmail.com
Rich was friendly & immediately helpful. Couldn't
Rich was friendly & immediately helpful. Couldn't get into my website to update it & had let the situation drag on for months. Clicked on this website & Rich was friendly & immediately helpful, said he could sort things out and did so with promptness & efficiency - not rushing off afterwards, but taking time to make sure the job was done properly. I'd certainly use this company again when I next have a problem. Well worth $120.
John Gordon
Published:
John Gordon
john@teamangelica.com
"If you have a problem with your website, or want
"If you have a problem with your website, or want to add some special functionality, you need to deal with someone you can trust who will fix your problem without making things worse. Finding someone like this is risky. How do you know he or she can do the job? How do you know you won't be left hanging? From our direct experience you can place your trust in these guys. The word 'fantastic' is much over-used these day but these people really are fantastic. Coming fresh into our site and knowing nothing about the specific software we were using, within minutes they were fixing issues. Frankly, I have no idea how you get this good. It's almost super-human. And when they hit a speed-bump, they don't turn around and place the onus on you like many specialists or blame someone else: they just fix it and move on. I trusted our entire site to them - more than 100 man-years of content - and within days we were completely fixed."
Stefan Youngs
Published:
Stefan Youngs
kildare4ever@icloud.com
Our website has an interface to another firm'
Our website has an interface to another firm's website so that prospective clients can leave their contact information for follow-up and tracking. This important hand-off function stopped working. I found Rich at The Computer Geek via search. He fixed this problem the same day, and improved the screen appearance for the prospective clients as well. The whole process was fast and efficient. I recommend this organization.
Tom Nutter
Published:
Tom Nutter
thomashnutter@gmail.com
Once again, Rich and his team have done it again!
Once again, Rich and his team have done it again! My outofbodies.com band website needed a quick fix that I couldn't for the life of me figure out how to do - and Rich took care of it! I will always come back to these guys - they're beyond great! They're friendly, thorough and quick! Got me up and running - I highly recommend them!
Donald Jefferes
Published:
Donald Jefferes
jzerony@aol.com
[Read More Testimonials Here]

Latest Website Related Articles

How to Improve Sound Quality on Zoom

Published: July 26, 2021
These days almost everything we do is at home and online. It seems almost every day brings a new Zoom or Google Hangouts meeting. To improve the way we sound on these calls, many of us have bought USB microphones, headsets, or new computers so ...[Read More]

 

What is an NFT

Published: July 10, 2021
There's a new form of tech making waves and leaving loads of people confused. Is it a new cryptocurrency? Not quite. We're talking about NFT's of course, the newest buzzword in tech. NFT stands for 'non-fungible token' or in simpler terms a one...[Read More]

 


Here are some links to related topics:
 search engine optimization seo specialist,   cloudflare consultant,   speed up your wordpress,   bluehost account hacked,   xcart hacked,   ehost hacked,  


Site Secured By The Website Guardian