-2
我想弄清楚爲什麼我的php錯誤日誌給了我這個錯誤。 PHP警告:stristr():在第25行的filename.php中的空分隔符PHP警告:stristr():在第25行的file.php中的空分隔符
現在我已經看了一行,沒有一個變量是空的。所以這方面的幫助會很大,因爲我找不到任何問題。它也行,但只是發出警告。我想看看我能否修復它。以下是整個代碼。
<?php
if(!$db = @mysql_connect("$dbhost", "$dbuser", "$dbpass"))
die('<font size=+1>An Error Occurred</font><hr>Unable to connect to the database. <BR>Check $dbhost, $dbuser, and $dbpass in config.php.');
if([email protected]_select_db("$dbname",$db))
die("<font size=+1>An Error Occurred</font><hr>Unable to find the database <b>$dbname</b> on your MySQL server.");
if (isset($dj)) {
$dj = NULL;
}
$query="SELECT * FROM currentdj";
$result=mysql_query($query);
while($row = mysql_fetch_array($result)) {
$did = $row['dj'];
$aliasa = $row['alias1'];
$aliasb = $row['alias2'];
$aliasc = $row['alias3'];
// The following code should detect DJ by song title, for Podcast and Audio Fictions
if ((isset($aliasa)) && (stristr($song[0], $aliasa) !== FALSE)) {
$setby = "Alias1";
$dj = $did;
}
if ((isset($aliasb)) && (stristr($song[0], $aliasb) !== FALSE)) {
$setby = "Alias1";
$dj = $did;
}
if ((isset($aliasc)) && (stristr($song[0], $aliasc) !== FALSE)) {
$setby = "Alias1";
$dj = $did;
}
// The following code should detect DJ by server title, for DJS and autodj
if ((isset($aliasa)) && (stristr($servertitle, $aliasa) !== FALSE)) {
$setby = "Alias1";
$dj = $did;
}
if ((isset($aliasb)) && (stristr($servertitle, $aliasb) !== FALSE)) {
$setby = "Alias2";
$dj = $did;
}
if ((isset($aliasc)) && (stristr($servertitle, $aliasc) !== FALSE)) {
$setby = "Alias3";
$dj = $did;
}
}
?>
所以我得到這個警告我所有的If isset語句。
是什麼$歌[0]決心? –
$ song [0]是在shout-cast服務器上播放的當前歌曲。 它不是空的,因爲它回聲良好 – Feek
你確定$ aliasa不是空的嗎? – samitny