Answer the question
In order to leave comments, you need to log in
How to retrieve user settings from database in php?
Hello everyone, I need a little help, how can I take user data from the database and push it into php?
Example:
Here is the user's data, from here you need to display code and code2 in php
as I tried to display all this in php :)
i.e. you need to store data from the database in the php file, each user's data is different
Answer the question
In order to leave comments, you need to log in
Well, it's kind of simple here ... Let's say the file name will be 1.json, where 1 is the id of the desired user. And write JSON data to this file: json_encode($data)
If you have a database, why store data in PHP?
PHP script started, suffered and died.
If you wanted to take them out, then
$query = "SELECT code, code2 FROM user"; //если надо для всей таблицы
$query = "SELECT code, code2 FROM user WHERE id = 32"; //если надо для пользователя с ID 32
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question