Connecting to a Database

O

old.Pac

Guest
Use the following script:



<?php

// Set the variables for the database access:

$Host = "localhost";

$User = "username";

$Password = "password";

$DBName= "DBName";

$TableName = "TableName";


$Link = mysql_connect ($Host, $User, $Password);


That connects you to the database. You then do your queries etc. Then you close the database,



mysql_close ($Link);

?>


Hope that helped some people
 
O

old.Zaldbag

Guest
it did a little, but can you explain the rest? Like getting the data from the table and making the query. Thanks
 
O

old.Pac

Guest
ok, what I will do is make a .zip file with the .php files in and instructions on how to use them.

I will post the link on here.
 
O

old.Enterprise

Guest
This is a good example. MySQL is not one of my strong points as I don't use it in my scripts.

Yeah there should be a forum like this for Perl.
 

Users who are viewing this thread

Top Bottom