MySql Condition not working in trigger
Found_it is null when declared. If no row matches the query that looks for album and userid found_it is not updated, i.e. it is still null. The test 

found_it!=1 (use found_it &lt;&gt; 1 instead)


therefor evaluates to NULL ( NULL &lt;> 1 => NULL ). You can prevent this by a default constraint in your declaration:

DECLARE found_it INT DEFAULT 0;


Now the test will evaluate to FALSE.