Обновление таблицы в реальном времени mysql php js
2 USDНужно сделать динамический вывод таблицы из базы данных т.е что бы в ней при изменение строк, отображались изменения в реальном времени без перезагрузки страницы (когда добавили строку, она должна автоматически вывестись в таблице). Есть база данных, в которой есть таблица users.
Есть столбцы id, name, lastname.
Таблицу вывожу таким кодом:
<?php
$host = 'localhost';
$db = 'aasinua_test';
$user = 'aasinua_test';
$pass = '1q2w3e4r5t6y';
$charset = 'utf8';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
];
$pdo = new PDO($dsn, $user, $pass, $opt);
$stmt = $pdo->query("SELECT * FROM users");
while ($row = $stmt->fetch()) {
echo "<span>".$row['name']." ".$row['lastname']."</span>";
}
?>
-
499 24 0 1 Доброго времени суток!
Готов выполнить в пределах часа, скорее всего тригер на инсерт не получится настроить, поэтому можем просто стучать через каждые n-секунд.
В общем обращайтесь.
-
897 167 0 1 Добрый день. Готов взяться за выполнение Вашего задания. Сделаю быстро.
-
735 141 0 1 Готов организовать обращайтесь
\=\=\=\=\=\=\=\=\=\=\=\=\=\=\=\
-

Единственное, что можно сделать, так это дёргать ваш пхп setintervalom каждые n секунд....
А в остальном все просто. Ставите nodjs. Подымаете вебсокет. Пишите процедуру в мускуле, которая будет дергать ваше апи при инсерте в таблицу. А дальше нода пушит по сокету на фронт.
Думаю, разберетесь за 100грн сами)
-
Current freelance projects in the category Databases & SQL
It is necessary to check the scripts and update the data in the Postgres database.It is necessary to correct the SQL scripts for the Postgres database. It is required to check the scripts and update data from external Excel tables and between two Postgres databases (different servers). Scripts will be run through AnyDesk using Navicat. List of data for… Databases & SQL ∙ 1 day 13 hours back ∙ 18 proposals |
Need an Airtable architect to build a relational schema and a new clean Airtable base.Need help rethinking and building a clean relational schema for an internal operational system on Airtable. The current database is already in use by the team, but it has grown organically: the structure is partially flat, some tables/views are actively used, while others are… Databases & SQL, Desktop Apps ∙ 2 days 7 hours back ∙ 9 proposals |
Basketball Coaching Education Platform + Custom CMSBasketball Coaching Education Platform + Custom CMSProject Overview We are looking for an experienced web development team or full-stack developer to build a modern basketball coaching education platform. The website will provide basketball coaches with access to educational… Databases & SQL, Web Programming ∙ 3 days back ∙ 89 proposals |
Integration of Viber in 8.3
223 USD
Need Viber integration into own CRM (1C 8.3)About the Company The company "Domofon System" is engaged in the installation and maintenance of intercom systems. Base of over 40,000 subscribers. We work on our own customized system based on 1C 8.3. We are looking for a specialist… Databases & SQL, Bot Development ∙ 3 days 4 hours back ∙ 16 proposals |
Refinement of 1C UT 11 for Zebra TSD (RDP): different sound signals when scanning
22 USD
Configuration: 1C UT 11 Address warehouse Zebra TC26 TSD Work via RDP Product scanning is performed in receiving, placement, picking documents, and other warehouse operations. Current problem: Warehouse workers operate through the Zebra TSD. When scanning, they do not always… C#, Databases & SQL ∙ 5 days 2 hours back ∙ 6 proposals |