zapytanie $CHECK_REGION_EXISTANCE zwraca 0 lub 1
i tak np w 1szym przebiegu pętli
echo $CHECK_REGION_EXISTANCE; = 1 i $value jest różny od 'x'
takie rezultaty zwracają echo w skrypcie w 1szym przebiegu
SELECT dbo.kc_checkRegionExistance(11, 1 )
1 // to jest $value
1 ins // a to jest wynik funkcji check existance
INSERT INTO dbo.kc_userregions(user_id, region_id) VALUES(11, 1 )
dlaczego więc echo $INSERT_REGION_TO_USER . '<br />'; wypisuje to na ekran a nie powinno
foreach( $_POST['regions'] as $value ) { require( '../../querries/querries.php' ); //if check existance function returns 0 then INSERT is running else not $rowExistInsert = $dbh->prepare( $CHECK_REGION_EXISTANCE ); $rowExistInsert->execute(); if( $rowExistInsert->fetchColumn() == 0 && $value != 'x' ) { //$insertRegion = $dbh->prepare( $INSERT_REGION_TO_USER ); //$insertRegion->execute(); } }