The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(257) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/printthread.php(257) : eval()'d code 2 errorHandler->error
/printthread.php 257 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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. Smile

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("
  SELECT ... (query here)
");
$result = mysql_fetch_assoc($query); // assuming the query returns a single row
// check the contents of $result here

- Ben