close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How to check two unique value in the same record of the database?

Thread began 9/10/2018 11:45 am by tony | Last modified 10/17/2018 11:47 am by tony | 173 views | 11 replies

tony

Originally Said By: Ray Borduin
  This is the correct technique, but you shouldn't need to add the reformatting in DataBridge 2. You just change the data type to "t" like:

php:
<?php

$rs_doppioni 
= new WA_MySQLi_RS("rs_doppioni",$conn_registrazione_i,1);
$rs_doppioni->setQuery("SELECT * FROM registrazioni WHERE registrazioni.ora_scontrino_reg = ? AND  registrazioni.data_scontrino_reg = ? AND  registrazioni.minuti_scontrino_reg = ?  AND  registrazioni.numero_scontrino_reg = ?");
$rs_doppioni->bindParam("t""".((isset($_POST["ora_scontrino_reg"]))?$_POST["ora_scontrino_reg"]:"")  ."""-1"); //orascontrino
$rs_doppioni->bindParam("t""".((isset($_POST["data_scontrino_reg"]))?$_POST["data_scontrino_reg"]:"")  ."""-1"); //datascontrino
$rs_doppioni->bindParam("t""".((isset($_POST["minuti_scontrino_reg"]))?$_POST["minuti_scontrino_reg"]:"")  ."""-1"); //minutiscontrino
$rs_doppioni->bindParam("t""".((isset($_POST["numero_scontrino_reg"]))?$_POST["numero_scontrino_reg"]:"")  ."""-1"); //numeroscontrino
$rs_doppioni->execute();
?>


What does the validation code look like? Maybe that is where the mistake is.  



Hi Ray,
please consider the DATE is collected using the datepicker in the dd/mm/yyyy format.
Do DB2 take care of this and convert the date from dd/mm/yyyy to yyyy-mm-dd (database format) on the fly?

Anyway, here is the recordset code and the WA code related to it:

php:
<?php

$rs_doppioni 
= new WA_MySQLi_RS("rs_doppioni",$conn_registrazione_i,1);
$rs_doppioni->setQuery("SELECT registrazioni.data_scontrino_reg, registrazioni.ora_scontrino_reg, registrazioni.minuti_scontrino_reg, registrazioni.numero_scontrino_reg FROM registrazioni WHERE registrazioni.data_scontrino_reg = ? AND registrazioni.ora_scontrino_reg = ? AND registrazioni.minuti_scontrino_reg = ? AND registrazioni.numero_scontrino_reg = ?");
$rs_doppioni->bindParam("t""".(isset($_POST['data_scontrino_reg'])?$_POST['data_scontrino_reg']:"")  ."""2018-10-16"); //WAQB_Param1
$rs_doppioni->bindParam("s""".(isset($_POST['ora_scontrino_reg'])?$_POST['ora_scontrino_reg']:"")  ."""10"); //WAQB_Param2
$rs_doppioni->bindParam("s""".(isset($_POST['minuti_scontrino_reg'])?$_POST['minuti_scontrino_reg']:"")  ."""15"); //WAQB_Param3
$rs_doppioni->bindParam("s""".(isset($_POST['numero_scontrino_reg'])?$_POST['numero_scontrino_reg']:"")  ."""100"); //WAQB_Param4
$rs_doppioni->execute();
?>



Note: the inserted values above ("2018-10-16" and so on) are only temporary; I use them just to be sure the query works. Then, in production, I subtituite them with "-1".

validation:

php:
$WAFV_Errors .= WAValidateNM($rs_doppioni->TotalRows . "",-1,0,""," ,",true,17);



TIA
tony

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...