inital commit
This commit is contained in:
38
webroot/rtgscript.php
Normal file
38
webroot/rtgscript.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
require("Staff/dbconfig.php");
|
||||
$created_date = "2015-08-28 00:00:00";
|
||||
$sql = "select * from sertg where created_on >= '".$created_date. "' AND client_id > 0 ";
|
||||
|
||||
$result = $conn->query($sql);
|
||||
$count = 0;
|
||||
if ($result->num_rows > 0){
|
||||
while($row = $result->fetch_assoc()){
|
||||
|
||||
$client_id = $row["client_id"];
|
||||
$member_id = $row["member_id"];
|
||||
|
||||
$sql1 = "select * from clients where id=". $client_id. " AND cmsuser_id=".$member_id;
|
||||
|
||||
$result1 = $conn->query($sql1);
|
||||
if($result1->num_rows < 1){
|
||||
// echo $sql1;echo "<br/>";
|
||||
|
||||
$sql2 = " select * from contacts where is_primary_contact=1 AND id=".$client_id." AND cmsuser_id=".$member_id;
|
||||
$result12 = $conn->query($sql2);
|
||||
while($row2 = $result12->fetch_assoc()){
|
||||
|
||||
$sql3 = "update sertg set client_id=".$row2["client_id"]." where id=".$row["id"]." AND member_id=".$member_id.";";
|
||||
$count++;
|
||||
echo $sql3;
|
||||
echo "<br/>";
|
||||
}
|
||||
// $count++;
|
||||
// echo $row["id"];
|
||||
// echo "<br/>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//echo "Total rows : ".$count;
|
||||
Reference in New Issue
Block a user