0
Hello, good morning. I have the following problem:
I want to handle SQL output using PHP, displaying the values individually and custom.
For example, I have a database with the values
Tomate | Cebola | Milho
2 4 1
I would like to do something with PHP of this genre
<?php
$conn = mysqli_connect ("localhost", "usuario", "senha", "banco");
$sql = "SELECT * FROM tabela";
$query = mysqli_query ($conn, $sql);
/*não sei como "transformaria" o resultado das consultas
em variaveis individuais*/
echo "Você tem $x Tomate(s), $y Cebola(s) e $z Milho(s)";
?>
How can I do what I need???
Thank you, friend. I would also like to know if there is any way to do this using jQuery and ajax, to make things dynamic.
– programadornoobie
Yes, you play the data via ajax to a script php file that runs the query, to receive data would be the same idea, check out this post http://programmerblog.net/php-pdo-ajax-tutorial-example/
– Jaffe.Marques
Thank you very much!!!!!!!!!!!
– programadornoobie