PHP question!(Crying)

Asked 2 years ago, Updated 2 years ago, 41 views

I'm trying to build a system for texting...

There is a part where you receive PHP API from an existing text company and enter the reception number

$_POST['receiver'] = '010xxx,010xxxx,... '; //You can type it like this.

So I sent a text message through the web server. The problem is that I'm going to take data from my MYSQL database and use it....

I made a separate PHP statement. I even tried to save the number on the web page that enters the number, save the number on the DB, print the data on the DB, and print the number on the web page that I made separately...

The problem is that I would like to know how to retrieve the number part from the DB and insert it in the above code part in the PHP statement received from the text company other than the web page output (ECHO)...

I tried to put it in using mysqli_fetch_array() function, but it didn't work well

I'd appreciate it if you could help me!

php mysql

2022-09-20 20:02

1 Answers

// Please study and write PDO.
$pdo = new \PDO (blah blah);
$statement = $pdo->preare ("SELECT contact FROM users WHERE");
$statement->execute();
$users = $statement->fetchAll(\PDO::FETCH_ASSOC);

// This is the fun part
// Let's study the implicit(), array_column() functions.
$receivers = implode(',', array_column($users, 'contact'));
var_dump($receivers);


2022-09-20 20:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.