Skip to content

Instantly share code, notes, and snippets.

@sidor1989
Last active November 7, 2017 09:14
Show Gist options
  • Save sidor1989/d25a85ab191331bebb6ab2269fcfa700 to your computer and use it in GitHub Desktop.
Save sidor1989/d25a85ab191331bebb6ab2269fcfa700 to your computer and use it in GitHub Desktop.
compare field
<?
function compare_art($conect, $article){
//check cvs article with db article
$sql_search_art = "SELECT `article` FROM `wp_ms2_products` WHERE `article` = '{$article}';";
$result=$conect->query($sql_search_art);
if(!$result){
echo "Нет соединения с базой данных.";
}
if($result->num_rows>0){
return false;
}else{
return true;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment