mysqli example with different PHP nesting