Lets see in the added.php in that example:
<?
include("connect.php");
function check_data($content,$table,$field)
{
$sql="SELECT * FROM $table WHERE $field='".mysql_real_escape_string($content)."'";
if (mysql_num_rows(mysql_query($sql))>0)
return(true);
else
return(false);
}
if(check_data($_POST["textfield1"], "your_table", "textfield1")==true)
{
$failes.='textfield1 field has already has a data You entered!<br>';
$was_failed=1;
}
if(isset($was_failed))
print "errors in your form:".$failes;
else
{
//insert or update
}
?>
http://phpcode.hu/phpgenerator2/c4ca4238a0b923820dcc509a6f75849b/98f13708210194c475687be6106a3b84/3416a75f4cea9109507cacd8e2f2aefc/php_programs_sql_create_www_phpcode_hu.zip
rm_phpbuilder;10891710 wrote:Hi everyone.
I want to run php code after updating the textbox to verify value that I type is inside my database already?
ex. I am typing on textbox I want to know if the value that I type is already inside my database I have multiple list of textboxes.
Thank you.