il campo photoid e numero o testo?
Per i campi numerici togli gli apici (photoid=$photoid)