私は考えられるすべてのことを試しました...私のローカルホストから別のサーバーホストに移動します(サーバーでftpを使用しているため、ローカルホストも使用しているようです)、それでもエラーが発生し続けます:警告:mysqli :: mysqli( )[mysqli.mysqli]:(28000/1045):/www/zxq.net/a/p/p/(のユーザー'(打ち切り)_zxq' @ '192.168.1.1'(パスワード:YESを使用)のアクセスが拒否されました6行目のcensored)/htdocs/lib.php接続に失敗しました:ユーザー'(打ち切り)_zxq' @ '192.168.1.1'のアクセスが拒否されました(パスワードを使用:YES)
私もmysqlをサポートする複数のホストを試しました...私はそのエラーを受け取り続け、私の資格情報が正しいことを知っています。そして、私はデータベースにもユーザーにも権限を与えました。助言がありますか?(ps。私は私にとって重要な情報を検閲しました)
<?php
$server = 'localhost';
$login = '792981_kputts';
$password = 'whatup4u';
$database = '(censored)_zxq_ireport';
//access
$connection = new mysqli($server, $login, $password, $database);
//executes a given sql query with the params and returns an array as result
function query() {
global $link;
$debug = false;
//get the sql query
$args = func_get_args();
$sql = array_shift($args);
//secure the input
for ($i=0;$i<count($args);$i++) {
$args[$i] = urldecode($args[$i]);
$args[$i] = mysqli_real_escape_string($link, $args[$i]);
}
//build the final query
$sql = vsprintf($sql, $args);
if ($debug) print $sql;
//execute and fetch the results
$result = mysqli_query($link, $sql);
if (mysqli_errno($link)==0 && $result) {
$rows = array();
if ($result!==true)
while ($d = mysqli_fetch_assoc($result)) {
array_push($rows,$d);
}
//return json
return array('result'=>$rows);
} else {
//error
return array('error'=>'Database error');
}
}
//loads up the source image, resizes it and saves with -thumb in the file name
function thumb($srcFile, $sideInPx) {
$image = imagecreatefromjpeg($srcFile);
$width = imagesx($image);
$height = imagesy($image);
$thumb = imagecreatetruecolor($sideInPx, $sideInPx);
imagecopyresized($thumb,$image,0,0,0,0,$sideInPx,$sideInPx,$width,$height);
imagejpeg($thumb, str_replace(".jpg","-thumb.jpg",$srcFile), 85);
imagedestroy($thumb);
imagedestroy($image);
}
?>