Jump to content

Help with echoing a message


lingo5

Recommended Posts

Hi, I need to echo the "Duplicate Entry Detected." inside a table in the html code of the page. At the moment it's echoing at the top of the page. I know it must be a simple thing to do....but I can't figure it out.

 

<?php 
$colname_checkdup_RS = "-1";  
if (isset($_POST['cliente_email'])) {
  $colname_checkdup_RS = $_POST['cliente_email'];
}
mysql_select_db($database_MySQLconnect, $MySQLconnect);
$query_checkdup_RS = sprintf("SELECT * FROM t_clientes WHERE cliente_email = %s", GetSQLValueString($colname_checkdup_RS, "text"));
$checkdup_RS = mysql_query($query_checkdup_RS, $MySQLconnect) or die(mysql_error());
$row_checkdup_RS = mysql_fetch_assoc($checkdup_RS);
$totalRows_checkdup_RS = mysql_num_rows($checkdup_RS);

if($totalRows_checkdup_RS==1)
{
echo "Duplicate Entry Detected.";
}

else{

$query = "INSERT INTO database.t_clientes (company_name,cliente_calle,cliente_numero,cliente_local,cliente_poblacion,cliente_cp,cliente_provincia,cliente_tel,cliente_fax,cliente_movil,cliente_personadecontacto,cliente_email,cliente_password,cliente_logo) ".

"VALUES ('$company_name','$cliente_calle','$cliente_numero','$cliente_local','$cliente_poblacion','$cliente_cp','$cliente_provincia','$cliente_tel','$cliente_fax','$cliente_movil','$cliente_personadecontacto','$cliente_email','$cliente_password','$filePath')";

mysql_query($query) or die('Error, query failed : ' . mysql_error()); 

header("Location: PC_clientes_display.php"); 
}
}
?>

Link to comment
https://forums.phpfreaks.com/topic/240015-help-with-echoing-a-message/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.