Sorry for all my posts lately. I wish my SS skills would be a lot better but so far you guys have been great in helping me and hopefully my posts will help some other SS newbies.
I'm wondering if anyone knows if it's possible to pass a variable from the URL into a function?
I have this function that I need to pass a variable into its mysql query.
function Alts() {
$db = new MySQLDatabase(array("server" => "localhost","username" => "****","password" => "*****","database" => "*****"));
$query = $db->query("SELECT * FROM roster WHERE Member='Alt' AND Owner=$variable ORDER BY Name ASC");
$result = new DataObjectSet();
foreach($query as $row) {
$result->push(new ArrayData($row));
}
return $result;
}
When I click a link like this: http://someurl.com?variable=Brig the mysql query would select on Member='Alt' and Owner='Brig'.
I've tried the normal PHP way of doing it but get an error, something like unexpected T_Variable.
Hopefully there is a way of doing this just that I haven't found it yet.
Thanks for taking the time to have a look.