Message script type='text/javascript'> not SHOWN at all ????

Dear all,

I got a BUTTON with Php code.
I’m doing the check if rows exist in order to show messages
If 1 --> Create rows
If 2 --> Message ‘No rows available…’

Why I see only echo "I AM HERE "; and nothing about <script type=‘text/javascript’>alert
It’s strange becouse if I’m not wrong it worked… (I’m running 8.1 now)

//Check rows
$sql_check_div = “SELECT IF( EXISTS( SELECT * FROM products_selected_rfq WHERE CustomerID= ‘glo_CustomerID’ ) , ‘1’, ‘2’ )”;
sc_lookup(my_data, $sql_check_div);
$result_sql = {my_data[0][0]};

if ($result_sql == 2)
{ echo "I AM HERE ";
echo “<script type=‘text/javascript’>alert(‘Non ci sono righe da elaborare - Selezionarne almeno un prodotto !
There are not rows to be elaborated - Select at list a product first !’);</script>”;
// sc_exit(sel);
}
else
{
echo "<script type=‘text/javascript’>alert('Attenzione ora verr? creata una RDO che comprender? tutte le righe selezionate
Tutte le righe dei prodotti precedentemente selezionate verranno poi cancellate

Attention, now it will be create an RFQ which will contain all rows selected
All row previously selected will be deleteted’);</script>";
//sc_exit(sel);

Don’t know right now, but if you will show an alert in all situations, use the same button context.
Change button to show on modal.
Do echo “Non ci sono righe da elaborare - Selezionarne almeno un prodotto !<br>There are not rows to be elaborated - Select at list a product first !”; // changed
by <br>
Don’t add sc_exit.

Result “it’s the same”

Hi Giu,
after three testing hours set on DESPERATION… mode I founded the LIGHT !!
It was only a sintax problem … UMBELIEVABLE for me loosing all that time for a message !!!

In this version all works as expected. Your suggestion are good the same !!!

$sql_check_div = “SELECT IF( EXISTS( SELECT * FROM products_selected where CustomerID = ‘glo_CustomerID’ ) , ‘1’, ‘2’ )”;
sc_lookup(my_data, $sql_check_div);
$result_sql = {my_data[0][0]};

if ($result_sql == 2)
{
echo ‘<script>alert(“Non ci sono righe da elaborare - Selezionarne almeno un prodotto !
There arenow rows to be elaborated - Select at list a product !”);</script>’;
sc_exit(sel);
}
else
{
echo '<script>alert("Attenzione ora verr? creato un ordine che comprender? tutte le righe selezionate - Tutte le righe dei prodotti precedentemente selezionate verranno poi cancellate

Attention, now it will be create an Order which will contain all rows selected
All row previously selected will be deleteted");</script>’;
//sc_exit(sel);

In your query replace ‘glo_CustomerID’ with ‘[glo_CustomerID]’

Ok. Thanks