Hello
First post here and new member. I am new to programming and have taken the responsibility to create a website where students get their marks online. I need help creating a table where the number of rows depends on how many of the logged on users fields are not empty and has value in them
For example if say the user has 7 fields of which are empty and 4 has value, I want the table to have 4 rows
And is it possible to put the sql table headers into the rows of above dynamic table.
Thanks in advance any help is much appreciated and sorry for the messy spelling
EDIT:
Sorry for the undetailed post ok here is as much detail I can provide as possible
Database is MySql or I assume its called that I am using the MySql server from xampp
Next I am using PHP to create a website where once a student inserts their username and password they get their results back
For each year they have attempted (passed a/o failed ) they get a card of that years end marks back
At the moment I can get all subject names back from database in which table they are headers and have stored them in an array
However I am stuck at not knowing how to determine which subject (column header)is null or has value in it
Here is how I get the said headers back
{{
$queryallsubname = $con->query("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'DatabaseName' AND TABLE_NAME = 'TableName'");
while($rowallsubname = $queryallsubname->fetch_assoc()){
$resultallsubname[] = $rowallsubname;
}
$columnArrallsubname = array_column($resultallsubname, 'COLUMN_NAME');
$numoftotalcol = count($columnArrallsubname);
for ($i=2; $i < $numoftotalcol; $i++) {
echo $columnArrallsubname[$i];
}
}}
I need a way to check which of the table columns above is empty/null so these not null headers will be the subject names of a year on the end card, as far as sources/guides go I am taking in everything I can find and anything I have tried so far fails
Thanks for the replies
What I have tried:
At the time of posting this question nothing, I was hoping for this to be my starting point