I am not great with SQL syntax and from my research of this issue I've been able to stumble on example of excluding columns from database queries, but not actual table results that will be returned.
A php script is running the below SQL query:
$query = $db->query("SELECT `team`, `points`, `goalsfor`, `goalsagainst`, `goalsdifference`, `matches`, `wins`, `draws`, `losses` FROM `".TABLE_PREFIX."myleagues_rows` WHERE `league` = {$lid} ORDER BY `points` DESC, `goalsdifference` DESC, `goalsfor` DESC, `goalsagainst` ASC");
It then references it again and inserts the data into a formatted HTML table, the next part of the query:
while($row = $db->fetch_array($query)) {
foreach($row as $name => $value) {
$teams[$row['team']][$name] = $value;
Full link to the php file in case I am missing important things.
My question, is that there's a row in that table with the team name "Test" that will be returned and inserted into the formatted table. I don't want to remove test team from the database but I do want to exclude it from the formatted table.
Am I best modifying the SQL query? Or is there something on the PHP side of things I can do instead?
Thanks for any advice and please point me in the right direction if I'm looking in the wrong place, I did not write the code (obviously).
Aucun commentaire:
Enregistrer un commentaire