Searching a specift data on a table I have to search in a table, all the photos that start with the code "2950".
Example: 2950_1, 2950_2 ...
Something like:

SELECT * FROM `vnd_imovelfoto` WHERE `codigofoto` = 2950
You should use LIKE comparison operator in this way:

SELECT *
FROM   vnd_imovelfoto 
WHERE  codigofoto LIKE '2950%'