Hi I made this.

$sqlhost = "localhost";
$sqluser = "root";
$sqlpasswd = "password";
$sqldatabase = "project";

class Connect {

var $link;

function Connect() {

$this->link = mysql_connect($sqlhost,$sqluser,$sqlpasswd);
$select = mysql_select_db($sqldatabase,$this->link);





$class = new Connect;

$query = "SELECT * from houses WHERE city='toronto'";

$result = mysql_query($query,$class->link);

$row = mysql_fetch_array($result);

echo "$row[title]"


What I'm trying to do is make a function or class that I can call up when
ever I want to connect to mysql.
If anyone can explain if I've done something wrong or if I'm not calling the
function up.

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to