Hi!
I need to get all the data out from the database. Maybe I have to get the data into a variable and then I can do stuff with it? (I'm doing stuff with the data in C#)
<?php
$con = mysqli_connect('topsecret');
if (mysqli_connect_errno())
{
echo "connection failed";
exit();
}
$sql = "SELECT * FROM data;";
mysqli_query($con, $sql) or die("Failed to get data");
echo "OK";
?>
Please help me with this simple SQL code
The "data" is a reserved mysql keyword (https://dev.mysql.com/doc/refman/8.0/en/keywords.html).
To be sure the query is valid use this syntax:
To be sure the query is valid use this syntax:
Code: Select all
SELECT * FROM `data`
Free coding lessons: https://php-forum.com/phpforum/viewtopic.php?t=29852