The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
PHP Validation: check if value exists in mysql db - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: PHP Validation: check if value exists in mysql db (/showthread.php?tid=751) Pages:
1
2
|
RE: PHP Validation: check if value exists in mysql db - Hannes - Aug 16th, 2010 (Aug 16th, 2010, 9:49 AM)Ben Wrote: (Just one thing: in this scenario, make sure the first parameter of ft_api_check_submission_is_unique is 1, not 2 - that should be your form ID). but then: where does it get it get the information that the column to check is in form2 and not in the posted form1? (no that there is no "2" in the code at all) In my understanding in this scenario it would check if the posted field is unique within the same form (not in another then the posted). best regards, Hannes RE: PHP Validation: check if value exists in mysql db - Ben - Aug 21st, 2010 Oh sorry! You're absolutely right - I didn't catch that detail. You were right the first time. ![]() Have you had any problem with it at all? - Ben RE: PHP Validation: check if value exists in mysql db - Hannes - Aug 21st, 2010 Ok, I will report if everything is working... Is there any way to make unique database queries as requierement?: For example to check if there there are enough specific seats left to submit a reservation. RE: PHP Validation: check if value exists in mysql db - Ben - Aug 22nd, 2010 Hi Hannes, Sure! If you need to construct a special query like that, you'll need to embed it in the PHP at the same spot as the ft_api_check_submission_is_unique function discussed above. Since you've included the API, the database connection is already made for you, so you just need to do your query and extract the results, e.g. Code: $query = mysql_query(" - Ben |