-1

このクエリがあります

 $DB->query("SELECT id FROM tfilter WHERE '". $Properties['Title'] ."' LIKE CONCAT('%', filter, '%')");

結果が得られた場合にスクリプトが死ぬようにする必要があります。今、私はこれを持っています:

    if($DB->record_count() != 0) {
    $Err = '<b>This cant be uploaded</b>';
    include(SERVER_ROOT . '/sections/upload/upload.php');
    die();

if($DB->record_count() != 0) {

これは別のものであるべきですか?死なないから結果が出たと分かっていても

このクエリは、phpscript では次のようになります。より大きなサイトの一部

$DB->query("SELECT id FROM tfilter WHERE '". $Properties['Title'] ."' LIKE CONCAT('%', filter, '%')");
 if($DB->record_count() != 0) {
 $Err = '<b>This cant be uploaded</b>';
 include(SERVER_ROOT . '/sections/upload/upload.php');
 die();

 $Properties['Title'] = String from the upload script that contains the titel.
 $DB is the call til mysql
 filter = the row in mysql
 tfilter = the database name

私が必要なものは何:

$Properties['Title'] に一致する行 FILTER のテーブル TFILTER を検索し、見つかった場合は DIE を検索するには、PHP が必要です。文字列の場合: The.White.Tiger. $Properties['Title'] に The.White.Tiger.In.The.Yard が含まれている場合、FILTER 行に存在し、php は DIE になります。

4

2 に答える 2

0

rowCount() を使用できませんか?

したがって、次のようになります。

$stmt = $DB->query("SELECT id FROM tfilter WHERE '". $Properties['Title'] ."' LIKE CONCAT('%', filter, '%')");
$numrows=$stmt->rowCount();

$error= $stmt->errorInfo();
echo $error[2];

if($numrows) {
$Err = '<b>This cant be uploaded</b>';
include(SERVER_ROOT . '/sections/upload/upload.php');
die();
于 2013-08-18T19:12:26.943 に答える