I'm trying to figure out how to pass several values in a format that appears suited to only passing one value.
What I'm doing is passing the name of a table used by a previous page to the current page. When I'm on the previous page, I have the table locked so nobody else can access it. When I go to the next page, I pass the name of the previous table to the new page, which unlocks it.
It looks like this:
(on the "previous page")
$thistable = cattable;
echo "<a href=\"index.php?prevtable=$thistable\">Next page</a>;
(on the "next page")
if ($prevtable) {
mysql_query("UPDATE " . $prevtable . " SET locked=NULL");
}
This all works GREAT - no problems at all.
The problem is, when I want $thistable to be multiple tables (some of my pages use multiple linked tables) - which I'll unlock using an EACH loop. I try
$thistable = array('cattable','dogtable');
and what gets passed along is the word "Array" as far as I can tell, rather than the contents of the array.
I want $thistable to be flexible enough to handle just one table or a list of tables. Would I be better off setting $thistable as a session variable (so it persists outside the page change), and then just unregistering it immediately after use? Or is there a neat way of passing an array in a URL, instead of just a single value?
Thanks!