May 22nd, 2011, 3:53 PM
(This post was last modified: May 22nd, 2011, 4:27 PM by floppyraid.)
Greetings again,
I cannot seem to get this thing going. I am hoping that I am overlooking something extremely simple. This is what I have as of right now.
As it is now, the data is always added to the table regardless of wither or not the information provided destined for col_2 is unique (col_2 is what the column is named for the unit id's)
Sorry, I've tried several ways and read and reread. I am a bit confused by what is mentioned on the page: http://docs.formtools.org/api/?page=ft_a..._is_unique
at the top it says
but a little further down it provides the example as:
perhaps i am overlooking something very basic (i am by no means proficient in php)
if anyone wants to sorta nudge me in the right direction i would be extremely greatful
-----
EDIT:
sorry, figured it out.
http://docs.formtools.org/tutorials/chec...ness_check
the bottom of the page explains in a little more detail what i needed to know to figure out how i was in error. i didnt see it linked anywhere on the site but a google search of ft_api_check_submission_is_unique picked it up
I cannot seem to get this thing going. I am hoping that I am overlooking something extremely simple. This is what I have as of right now.
Code:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(2);
include 'header.php';
$criteria = array(
"col_2" => $_POST["col_2"]
);
if (!ft_api_check_submission_is_unique(2, $criteria))
{
$already_exists = true;
}
else
{
$params = array(
"submit_button" => "czech",
"next_page" => "madprops.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
}
?>
<html><body><form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
Monitor ID: <input type="text" name="monitor_id">
Unit ID: <input type="text" name="unit_id">
<select name="location" size="1">
<?php
mysql_connect($sqlsrv,$username,$password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
$query = "SELECT DISTINCT location FROM inventory.inventory";
$result = mysql_query($query);
if(mysql_num_rows($result)) {
while($row = mysql_fetch_row($result))
{ print("<option value=\"$row[0]\">$row[0]</option>"); }
} else { print("<option value=\"\">NO LOCATIONS?!</option>"); }
?>
</select>
<input type="hidden" name="returned" value="N">
<input type="submit" name="czech">
</center></div></form></body></html>
As it is now, the data is always added to the table regardless of wither or not the information provided destined for col_2 is unique (col_2 is what the column is named for the unit id's)
Sorry, I've tried several ways and read and reread. I am a bit confused by what is mentioned on the page: http://docs.formtools.org/api/?page=ft_a..._is_unique
at the top it says
Code:
ft_api_check_submission_is_unique($form_id, $criteria, $submission_id]);
Code:
if (!ft_api_check_submission_is_unique(10, $criteria, $fields["form_tools_submission_id"]))
perhaps i am overlooking something very basic (i am by no means proficient in php)
if anyone wants to sorta nudge me in the right direction i would be extremely greatful
-----
EDIT:
sorry, figured it out.
http://docs.formtools.org/tutorials/chec...ness_check
the bottom of the page explains in a little more detail what i needed to know to figure out how i was in error. i didnt see it linked anywhere on the site but a google search of ft_api_check_submission_is_unique picked it up