I
I
Ibrahim Kadirov2015-09-07 11:17:57
PHP
Ibrahim Kadirov, 2015-09-07 11:17:57

Recommend a platform (engine or plugin) for the online consulting service in directions?

Recommend a platform (engine or similar) for the online consulting service in directions? I want to create an online consultation. Give options for solutions.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
D
DevMan, 2019-03-30
@Us59

there is no need to take the code from these internets of yours if there is no understanding of what and how it works/should work.
puff has one of the best documentation I've ever seen in a japanese, with tons of examples.

M
Maxim, 2019-03-30
@ikfah012

Do you even understand what your code means?
Don't copy-paste if you don't know the basics.
First, the normal practice is to put the connection parameters in a separate file.
Create a db.php file with the following code:

<?php

//Параметры подключения в БД
$host = "localhost"; //имя хоста
$database = "base"; //имя базы
$user = "root"; //пользователь
$password = "pass"; //пароль
$dbtable = "table"; //таблица

$link = mysqli_connect($host, $user, $password, $database)
or die("Ошибка " . mysqli_error($link));

?>

Then, in your main file, you include it with: How to access the database and, most importantly, why you should understand yourself. I'll give you an example. I am doing a search for clients in the database by last name or phone number, my code is as follows:
function search_users() {  //объявляем функцию
  $query = strip_tags(trim($_POST['query']));  //принимаем данные из формы поиска
  if (preg_match('/[0-9]/', $query)) { //задаём условия для поиска (в данном случае совпадения номера или строки
    $sql = "SELECT * FROM Users WHERE phone LIKE '%$query%' ORDER BY id DESC"; //делаем выборку в базе по телефону
  }
  else {
    $sql = "SELECT * FROM Users WHERE surname LIKE '%$query%' ORDER BY id DESC"; //делаем выборку в базе по фамилии
  }
    global $link;
    $result = mysqli_query($link, $sql);
    $users = mysqli_fetch_all($result, MYSQLI_ASSOC);
    return $users;  //выводим результат
}

Start with the very basics. If you don’t know how to make queries in the database and don’t know the php syntax, then you shouldn’t just copy pieces of code from the Internet. It's better to figure it out on your own and ask questions here :) good luck

G
grinat, 2019-03-31
@grinat

It is necessary in this class to replace the connection parameters with your own, i.e. replace private static $_db_address with private static $_db_address = 'localhost' etc. call everywhere like:
$connect = CConnectionSingleton::getInstanse();
$users = $connect->sql2data('SELECT * FROM users');

D
Dmitry, 2015-09-07
@2fox

www.question2answer.org

A
Alex, 2015-09-07
@mr_ko

Yes, any online chat. Here is a free version of www.siteheart.com

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question