Ich suche nach Hilfe, um die Farbe einer Zelle in einer Tabelle zu ändern. Es funktioniert, wenn ich if(isset($_POST['showapp'])){
entferne, aber ich will nur, dass es geschieht, wenn der Knopf geklickt wird. Hilfe wird sehr geschätzt.Ändern Sie die Zellen der Tabelle, wenn Taste gedrückt
print '<input name="showapp" type="submit" value="Show Appointments">';
$sqlapp = "SELECT StudentID FROM timetable WHERE Username='{$_SESSION["student"]}'";
$resultapp = mysql_query($sqlapp);
if(isset($_POST['showapp'])){
if (in_array($resultapp, $myarray0)){
$colour0="yellow";
}
if (in_array($resultapp, $myarray1)){
$colour1="yellow";
}
if (in_array($resultapp, $myarray2)){
$colour2="yellow";
}
if (in_array($resultapp, $myarray3)){
$colour3="yellow";
}
if (in_array($resultapp, $myarray4)){
$colour4="yellow";
}
if (in_array($resultapp, $myarray5)){
$colour5="yellow";
}
if (in_array($resultapp, $myarray6)){
$colour6="yellow";
}
if (in_array($resultapp, $myarray7)){
$colour7="yellow";
}
}
erhalten Sie irgendwelche Fehler? –
Nein, der Button tut einfach nichts. Wie ich sagte, wenn ich entferne (isset (....)) dann leuchtet die Zelle gelb auf. – Razold1406
Alle Farben sind gelb ... auch Sie setzen jedesmal eine andere Variable –