I need to know how to pass the data's from database to a constructor like this
"Jungle Book" => new Book("Jungle Book", "R. Kipling", "A classic book."),
"Moonwalker" => new Book("Moonwalker", "J. Walker", ""),
"PHP for Dummies" => new Book("PHP for Dummies", "Some Smart Guy", "")
my coding is
$data = mysql_query("SELECT * FROM books") or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$title=$info['title'];
$Author =$info['Author'];
$Description=$info['Description'];
$info['title'];=> new Book ($title,$Author,$Description);
}
but it's showing error like this
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /opt/lampp/htdocs/mvc/model/Model.php on line 29
i dono how to do can anyone suggest me how to implement this concept r solving this error :(:'(:'(:'(:'(:'(:'(:'(:'(:'(