( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ HEX
HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux mail.thebrand.ai 6.8.0-107-generic #107-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 13 19:51:50 UTC 2026 x86_64
User: www-data (33)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/createUpdateDigitalBusinesses.php
<?php


set_time_limit(100000);

include("includes/limittext.php");
include('Connections/videoondemand.php');
require("DbSql2.inc.php");
require("NewsSql2.inc.php");
include("includes/processFunctionsX.php");
include("const.inc.php");
$db = new NewsSQL();
include("protect.php");
global $link;





   $stmt2 ="select * from  usersdigital  where status ='unsubscribed'  ORDER BY id DESC LIMIT  0,1000";


$query = mysqli_query($link,$stmt2) or die(mysqli_error());

while ($row = mysqli_fetch_array($query, MYSQLI_ASSOC)) {

    $string = 'Fabrice

floyfub@gmail.com
707073509';
    $string=$row["name"];
 echo    $id=$row["id"];
    // Extract the name
    $namePattern = '/^[A-Za-z\s]+$/m';
    preg_match($namePattern, $string, $nameMatches);
    $name = $nameMatches[0] ?? '';

// Extract the email
    $emailPattern = '/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/';
    preg_match($emailPattern, $string, $emailMatches);
    $email = $emailMatches[0] ?? '';

// Extract the number
    $numberPattern = '/\d{9,12}/'; // This pattern looks for numbers between 9 to 12 digits
    preg_match($numberPattern, $string, $numberMatches);
    $number = $numberMatches[0] ?? '';

    echo "Name: " . $name . "\n";
    echo "Email: " . $email . "\n";
    echo "Number: " . $number . "\n";


if(!empty($name))
{
  echo  $sql = "UPDATE usersdigital SET name = '$name'  WHERE id = $id";

    if (mysqli_query($link, $sql)) {
        echo "Record updated $name successfully  <br>";
    } else {
        echo "Error updating record $name: " . mysqli_error($link);
    }
}
else
    {
       echo  $sql = "UPDATE usersdigital SET name = '$email'  WHERE id = $id";

        if (mysqli_query($link, $sql)) {
            echo "Record updated $email successfully  <br>";
        } else {
            echo "Error updating $email record: " . mysqli_error($link);
        }
    }

    if(!empty($number))
    {
      echo   $sql = "UPDATE usersdigital SET tel = '$number'  WHERE id = $id";

        if (mysqli_query($link, $sql)) {
            echo "Record updated $tel successfully  <br>";
        } else {
            echo "Error updating  $tel record: " . mysqli_error($link);
        }
    }






    echo  $sql = "UPDATE usersdigital SET status = '1'  WHERE id = $id";

    if (mysqli_query($link, $sql)) {
        echo "Record updated status successfully  <br>";
    } else {
        echo "Error updating record $id: " . mysqli_error($link);
    }

}




?>