学びながら1対1のチャットサイトを作ろうとしているのですが、行き詰まってしまいました。
データベースに書き込めません。
以下にリンクされている4つのphpファイルがあります。
- 索引
初期化:
session_start(); define('LOGGED_IN', true); require 'classes/Core.php'; require 'classes/Chat.php'; ?>
芯:
class Core { protected $db, $result; private $rows; public function __construct() { $this->db = new mysqli("localhost","root",""); } public function query($sql) { $this->result = $this->db->query($sql); } public function rows() { for($x = 1; $x <= $this->db->affected_rows; $x++) { $this->rows[] = $this->result->fetch_assoc(); } return $this->rows; } } ?>
WAMP で設定された MySql データベースがあります。
PS はい、「< ? php」を開きましたが、ここに表示されません。