So I've been struggling with my database to get it to give me the name of columns contained within a table.
Here's my PHP :
$sql = "SELECT * FROM hacklvrf_db.INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'generators'" ;
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$generators = $row['generators'];
foreach ($row as $lol) {
echo ($lol);
}
For some reason this isn't answering with anything (PHP doesn't pop an error but my variables seem to be empty) and I don't really understand what I'm missing.
echo (gettype ($row));
Shows a 'NULL'
I know this question has been asked before and I actually got my SQL query from other places but I since I can't work it out... here I am !
Thanks in advance guys !