government-owned
以下のphpスクリプトを使用して挿入しようとするとgovernment
、PHPmyAdminを使用すると完全に機能します。私のphpスクリプトに何か問題がありますか?
class database
{
private $config = array(
'host' => 'localhost',
'username' => 'root',
'password' => 'root',
'dbname' => 'yelo'
);
public function dbConnect(){
$dbcnx = @mysql_connect($this->config['host'], $this->config['username'], $this->config['password'])
or die("The site database appears to be down.");
if ($this->config['dbname']!="" and !@mysql_select_db($this->config['dbname']))
die("The site database is unavailable.");
return $dbcnx;
}
}
$connDb = new database;
$connDb->dbConnect();
// I thought this could eliminate the problem
$business_name = mysql_escape_string($_POST['business_name']);
$query = "INSERT INTO business SET biz_name = '$business_name'"
$result = mysql_query($query);
助けてくれてありがとう。