如何从查询等于任何数字的表中进行选择

I created a table that contains Names About Friend ID, and I want to get the following

    $query = mysql_query("SELECT * FROM `table` WHERE `Friend` = '$me' AND `ID` = 'Any Number'");
while($arr = mysql_fetch_array($query)){
$Names = $arr["Names"];
echo $Names;
echo "</br>";
}

So I want to select where ID equal to any number.

remove the id part from your query or you can write this

$query = mysql_query("SELECT * FROM `table` WHERE `Friend` = '$me' AND ID >0");

it can also work well in future if you want to add any condition on id you can edit it.

Remove the ID part:

$query = mysql_query("SELECT * FROM `table` WHERE `Friend` = '$me'");

also, don't use mysql_*, they are deprecated. Use mysqli or PDO instead.

If you mean Equal to any as you stated then you should remove condition

AND `ID` = 'Any Number'

Morover I would suggest to use PDO or Mysqli because mysql_* functions are depracated and will be removed in future relases.

If you want to test if ID is numeric you can do something like this:

SELECT * FROM `table` WHERE `Friend` = '$me' AND `ID` REGEXP ('[0-9]')

Use IS NOT NULL

$query = mysql_query("SELECT * FROM `table` WHERE `Friend` = '$me' AND `ID` IS NOT NULL);

It will return any number including 0 but it will not return the ones with empty values.

I hope this helps.