<?php /* * intermediate.php * * Copyright 2012 Tdlm <tdlm@tdlm> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * The code generates an HTML * table that holds the name of each movie and person, along * with ADD, EDIT, and DELETE links. */ //Start session session_start(); //Include database connection details //require_once make shore that the function only runs once on the server! require_once('config.php'); /*connect to MySQL without showing the Database details by importing the details ** from another file holding all permission and user files*/ $db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); if(!$db) { die('Failed to connect to server: ' . mysql_error()); } /*Then make sure you are connecting to the right database*/ //Select database mysql_select_db(DB_DATABASE) or die(mysql_error($db)); /* Done */ ?>