PHP で MySQL データベースから情報をフェッチするコードがあり、$username 変数と strpos() 関数を使用してこれらの情報を比較したいのですが、うまくいきません。どうすればよいですか?
$username = $_GET['username'];
$connection = new DB_Database();
$res = $connection->Select();
if ($res) {
$output = "";
while ($row = mysql_fetch_array($res)) {
if (strpos((string)$row['username'], $username)) {
$output.=" " . $row["username"] . " ";
}
echo $output;