如果“稀有”列值= 1,如何导出mysql数据

I've got an id grabbing script for a website and the dump.php selects all of the id's from the DB and dumps the id's cleanly into a .txt file. I was wondering how to modify it so it only dumps the id's deemed as "rare"; that is, the id grabber marks id's with patters as "rare" and assigns the "rare" column in the database to 1 while keeping "normal" id's as 0

$ids = $sql->select('*', '`ids` ORDER BY `UserId` ASC', NULL, NULL, NULL, true, true);

Is the current script, how do i get it to select the column "rare" where value = 1

Is the current script, how do i get it to select the column "rare" where value = 1

Exactly like you wrote:

select the column rare from ids where value rare = 1