ok
This commit is contained in:
parent
1b840256bf
commit
6fa5b90acb
14
src/cos.php
Normal file
14
src/cos.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
$polanczenie = mysqli_connect('192.168.1.100','root','secret','db');
|
||||
|
||||
$kwerenda = mysqli_query($polanczenie , "SELECT * FROM menu ORDER BY id ASC");
|
||||
|
||||
$json = array();
|
||||
|
||||
while ($row = mysqli_fetch_assoc($kwerenda)){
|
||||
$json[]= $row;
|
||||
}
|
||||
mysqli_close($polanczenie)
|
||||
|
||||
echo json_encode($json)
|
||||
?>
|
@ -1,4 +1,3 @@
|
||||
|
||||
export const fetchData = () => {
|
||||
return fetch('./php/get.php')
|
||||
.then(response => {
|
||||
|
@ -0,0 +1,6 @@
|
||||
export const fetchData = () => {
|
||||
return fetch('./php/get.php')
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
$polaczenie = mysqli_connect("172.18.0.4", "root", "secret", "db");
|
||||
$polaczenie = mysqli_connect("172.18.0.2", "root", "secret", "db");
|
||||
|
||||
//$kwerenda = mysqli_query($polaczenie, "SELECT id, nazwa, cena, data_dodania FROM menu ORDER BY id DESC LIMIT 3;");
|
||||
$kwerenda = mysqli_query($polaczenie, "SELECT * FROM menu ORDER BY id ASC");
|
||||
|
||||
$json = array();
|
||||
@ -13,4 +12,4 @@ while ($row = mysqli_fetch_assoc($kwerenda)) {
|
||||
mysqli_close($polaczenie);
|
||||
|
||||
echo json_encode($json );
|
||||
?>
|
||||
?>
|
15
src/php/gget.php
Normal file
15
src/php/gget.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$polaczenie = mysqli_connect("172.19.0.2", "root", "secret", "db");
|
||||
|
||||
$kwerenda = mysqli_query($polaczenie, "SELECT * FROM paliwa ORDER BY id DESC LIMIT 3;");
|
||||
|
||||
$json = array();
|
||||
|
||||
while($row = mysqli_fetch_assoc($kwerenda)) {
|
||||
$json [] = $row;
|
||||
};
|
||||
|
||||
echo json_encode($json);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user