in reply to MySql statement variable not working

Placeholders would definitely be the way to go here, IMHO.   Your SQL statement would be ... where gene_id = ? (notice that the question-mark is not quoted), and when you prepare or execute the query you supply $id as the only entry in an array of values.

Where this really starts to pay off is when you need to execute the same query many times, only with different values.   You “prepare” the statement once, then execute it as many times as you wish, providing a different $id each time.   All of the work involved in “deciding how to carry out this query” only occurs one time.   You never have to worry about SQL-injection or any of that nonsense.   I frankly make it a point to do every SQL query this way.   I never, ever include literal values in the string.   Placeholders are more expressive, less difficult, and technically superior.