[ create a new paste ] login | about

Link: http://codepad.org/wwGNrTJm    [ raw code | output | fork ]

PHP, pasted on Mar 2:
<?php

ini_set('display_errors','On');
error_reporting(E_ALL);

require_once 'includes/constants.php';

class Mysql 
{
	private $conn;
	
	function __construct() 
	{
		
		$this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or 
					  die('No Connection to database!');
	}
	
	function add_non_member($data) 
	{
		$email = $data->email;

		$san_email = mysql_real_escape_string($email);

		/*$un = "test@test.com";

		$query = "SELECT *
				FROM user
				WHERE email = ?
				LIMIT 1";
				
		if($stmt = $this->conn->prepare($query)) 
		{
			$stmt->bind_param('s', $un);
			$stmt->execute();
			
			if($stmt->fetch()) 
			{
				//echo $stmt->email;
				$stmt->close();
				return true;
			}
		}*/
		
	}
}


Output:
1
2
3
4

Warning: require_once(includes/constants.php): failed to open stream: No such file or directory on line 6

Fatal error: require_once(): Failed opening required 'includes/constants.php' (include_path='.:/usr/lib/php') on line 6


Create a new paste based on this one


Comments: