Jump to content

database connect script helppp


xxreenaxx1

Recommended Posts

Hey...

 

I was going through this sample that was given in the class, but got confused at the first point

 

"//change this to include your own database connect script.

include "../../dbconnect.php";"

 

and the database connection code is

 

"

<?php
if ($_POST['submit']) {
     // connect to your database
     $connection = pg_connect("port=5432  dbname=rr_ds user=nobody");
     if (!$connection) {
         die("Connection has failed: " . pg_last_error());
     }?>

"

 

the database connection code is from a previous assignment which i did, but that was for a login page. The current assignment is to connect to the database and have data on it.

Link to comment
https://forums.phpfreaks.com/topic/216408-database-connect-script-helppp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.