booking/work/data/dublucate_tretments.php

38 lines
897 B
PHP
Executable File

<?php
$done = false;
if (!$done) {
$name_db = "aqdamypanel_aqdamy";
$host_db = "localhost";
$user_db = "aqdamypanel_mysql";
$pass_db = "AST4dxy6vEsi";
$db = new mysqli($host_db, $user_db, $pass_db, $name_db);
if ($db->connect_error) {
die("Connection failed: " . $db->connect_error);
}
// Change db to "test" db //// mysqli_select_db($db, "test");
$Arabic= 'SET CHARACTER SET utf8';
mysqli_query($db,$Arabic) or die ('Can\'t charset in DataBase');
$db->set_charset("utf8");
$nit = '';
$query = mysqli_query($db,
"SELECT id
FROM tretment
WHERE `commercial_register_id` = 2
GROUP BY number
HAVING COUNT(id) > 1"
);
if (mysqli_num_rows($query) > 0) {
while ($row_from_old = mysqli_fetch_assoc($query)) {
$nit .= $row_from_old['id']. ', ';
}
}
echo $nit;
}
?>