Returning all records from a blank field
Hello.
I am struggling to find an answer to this which I sense should be easy enough but it defies my logic!
I have a recordset defined which is intended to display all records that match a URL parameter and then order them by year
<?php
$Value = new WA_MySQLi_RS("Value",$Fgrants,0);
$Value->setQuery("SELECT * FROM GrantLog WHERE Value LIKE ? ORDER BY Year ASC");
$Value->bindParam("c", "".($_GET['Value']) ."", "-1"); //colname
$Value->execute();
?>
It works just fine.
What I would like to add is that when the form field passing the parameter is left blank, then all records are displayed, ordered by year.
(There is a repeat region involved later on the page but I don't see that has any impact)
Being a MySQLi newbie, I am struggling to achieve this (and in fact whether this is the right place or the only place to make a change?)
Any help/pointers much appreciated.
Thank you.