I am trying to insert a database row into an object and I don't understand what is the problem here:(i can't see the output).
<body>
<?php header('Content-Type: text/html; charset=utf-8');
include("dash_class.php");
mysql_connect("localhost", "root", "") or
die("Could not connect: " . mysql_error());
mysql_select_db("msordash");
mysql_query("SET NAMES 'utf8'");
$dashim=mysql_query("SELECT * FROM dash");
while ($row = mysql_fetch_array($dashim)) {
$dash=new dash($row["name"],$row["msg"],$row["msg_date"]);
echo $dash->name;
}
?>
</body>
the class code:
class dash
{
public $name;
public $msg;
public $msg_date;
function __constractor($name,$msg,$msg_date){
$this->name=$name;
$this->msg=$msg;
$this->msg_date=$msg_date;}
}
?>
What is a constraaaaaaaaaactor? :) Sorry what is constractor
to be exact?
function __constractor($name,$msg,$msg_date){
it should be
__construct()
Like
function __construct($name,$msg,$msg_date){