UCI: Dean of Students: Campus Organizations: CORE Internet Services
News:
 
  Home   Forum   Help Search Login Register  
* *
Pages: [1]   Go Down
  Print  
Author Topic: What would a sample PHP/MySQL script look like?  (Read 2992 times)
jnickles
Guest
« on: November 13, 2006, 03:02:32 PM »


On the UCI Spirit server for a club named "sample", a typical connect script would look something like this...

Code:
<? // CONNECT TO DATABASE SCRIPT

$host = "localhost";
$db = "sample";
$user = "sample";
$pass = "password";

$connection = mysql_connect ($host, $user, $pass) or die ("** Could not connect. " . mysql_error() );

echo ("Connected. ");
mysql_select_db ($db) or die ("** Could not select database. ");
mysql_close ($connection);
?>
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Forum Login

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2009, 04:10:02 PM

Login with username, password and session length

Forum Information

Please Note: A CIS (formerly Spirit) forum account is currently different than a regular CIS account.

If you would like to participate in the Forum, you will need to register with a new nickname. We are working on integrating the two systems.

Recent Posts

TinyPortal v1.0 beta 3 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!