Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL help

Status
Not open for further replies.

rolfjf

Programmer
Jun 13, 2000
8
BR
Hi
How can I use a MySQL database with PHP?
How the MySQL works on the server?
Where I must put my files?
Can someone please send me an example source code to access a MySQL database?
I'm new to PHP...
thanks
Rolf

 
First you must install MySQL on your machine. You can go to to get the latest version.

PHP files usually has the extension .php or .php3 depending on your server config. You can put PHP files inside your website's document root directory. If you need examples, you can check out this site:
It has quite a lot of examples.

ttest
thum@starwarsfan.com
 
I'll also add that the book "Professional PHP Programming" was a big help getting me started with PHP and MySQL. Chapter 2 is titled "Installing and Configuring PHP", and has sections for the web server, PHP, and MySQL. It's not an all-encompassing reference book, but it is a good book - I use it all the time, along with the main php web site HTH.

Hardy Merrill
Mission Critical Linux, Inc.
 
<?php<br>
$host=&quot;localhost&quot;; <br>
$user=&quot;your user name&quot;;<br>
$password=&quot;your password&quot;; <br>
mysql_connect($host,$user,$password) or die(&quot;Failed&quot;);<br>
$result=mysql_db_query(&quot;database name&quot;,&quot;...operation you want....&quot;); <br>
-> get result to generate your html code <br>
....<br>
....<br>
mysql_close( );<br>




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top