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

I would like to compare / validate if the gift card number is valid

Thread began 1/20/2020 12:32 pm by Jonas | Last modified 3/02/2020 1:55 pm by Jonas | 262 views | 54 replies


Hi again Ray!
I would love to try again because I want to learn this. But I don't understand everything. Can we take it step by step?

So I want to verify if the booking number that the user fills in matches the database. If not, an error message should be displayed and it should not be possible to send the form. The form is written to the [Bokning] table, but the form field should be compared against the [Presentkort] table.

1. Create an Insert page using DataAssist.
We make it simple in this case, using only the current field from the database, [BokningPresentkortnrID], and create the page [test_insert.php].

2. Create a recordset and filter the number from the form field.
Here I am not really sure what table to use. Is it [Bokning] or [Presentkort]?
I'm also not sure how to write the query?
Is this correct:
$Recordset1->setQuery("SELECT Presentkort.* FROM Presentkort WHERE Presentkort.PresentkortID = ?");
$Recordset1->bindParam("i", "".((isset($_POST["BokningPresentkortnrID"]))?$_POST["BokningPresentkortnrID"]:"") ."", "-1"); //WAQB_Param1

If this is correct, what is the next step?

Here is the code from the form:
<form class="Basic_Default" id="Insert_Basic_Default" name="Insert_Basic_Default" method="post" action="">
<fieldset class="Basic_Default" id="Insert">
<legend class="groupHeader">Insert</legend>
<div class="lineGroup"> <label for="BokningPresentkortnrID" class="sublabel" > BokningPresentkortnrID:</label>
<input id="BokningPresentkortnrID" name="BokningPresentkortnrID" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("testinsert","BokningPresentkortnrID"):"")); ?>" class="formTextfield_Medium" tabindex="1" title="Please enter a value.">
<span class="buttonFieldGroup" >
<input type="submit" value="Insert" class="formButton" id="Insert" name="Insert" />

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





Ease of use


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...