An example connect is initialized to include 'conf.php'; Help to find and fix the error:
Warning: mysql_query() expects parameter 2 to be resource, null given in U:\home\project\www\core.php on line 12
core.php:
<?php include 'conf.php'; class Addpostdb{ var $name; var $text; function add($name,$text){ $query="INSERT INTO posts VALUES ( '$name','$text')"; if (mysql_query($query, $connect) or die("error:" . mysql_error())){ echo 'Выполнено'; } } } class Viewpost{ function view(){ $result=mysql_query('SELECT * FROM `posts`'); while($row=mysql_fetch_array($result)) { echo $row['name']. '<p>'.$row['post']; } } } ?>