Hi,

This is a small example to connect the Database.

<?
 function dedb_connect()
 {
 $link = mysql_pconnect("localhost","login","pass");
 if ($link && mysql_select_db("DBname"))
 return($link);
 return(FALSE);
  }
 ?>
and save as "dedb.inc"
And Then, in your php. file  Before you start any statement or query. put
this on first.
<?
include ("dedb.inc")
..........
..........your other query........
?>

OK...

Kelvin.


""James McLaughlin"" <[EMAIL PROTECTED]> wrote in message
000801c0ce20$9ab1e900$[EMAIL PROTECTED]">news:000801c0ce20$9ab1e900$[EMAIL PROTECTED]...
> This is my first time programming with PHP.  I have seen include files in
> the beginning of a php block and wonder is there a specific syntax used in
> these files and how secure this is vs code in my .php page?
>
> Can someone show me a small example of what the include file might look
like
> that would contain variables for  $mysql server, $username $password and
> $db_name.
>
> Any comments you may have about security involving files containing these
> variables and where to store them would be greatly appreciated.
>
>
>
> Thanks In Advance.
>
>
> Kat
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to