The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
I have been trying to do all code goingforward utilizing vb's input cleaner class as opposed to $_GET, $_POST, $_REQUEST, etc... but it doesn't seem to want to cooperate with me... The block of code i havew which works fine as-is, is:
Code:
$sql = "SELECT " . TABLE_PREFIX . "erc_artistmbr.*, " . TABLE_PREFIX . "erc_artist.artisttitle
FROM " . TABLE_PREFIX . "erc_artistmbr
LEFT JOIN " . TABLE_PREFIX . "erc_artist ON " . TABLE_PREFIX . "erc_artist.artistid = " . TABLE_PREFIX . "erc_artistmbr.artistid
";
if ($_GET['artistid'])
{
$sql .= " WHERE " . TABLE_PREFIX . "erc_artistmbr.artistid = '".$_GET['artistid']."'";
}
$sql .= " ORDER BY " . TABLE_PREFIX . "erc_artist.artisttitle, erc_artistmbr.displayorder";
$artistmbrs = $db->query_read($sql);
Code:
$getartistid = $vbulletin->input->clean_gpc('g', 'artistid', TYPE_INT);
$sql = "SELECT " . TABLE_PREFIX . "erc_artistmbr.*, " . TABLE_PREFIX . "erc_artist.artisttitle
FROM " . TABLE_PREFIX . "erc_artistmbr
LEFT JOIN " . TABLE_PREFIX . "erc_artist ON " . TABLE_PREFIX . "erc_artist.artistid = " . TABLE_PREFIX . "erc_artistmbr.artistid
";
if ($getartistid)
{
$sql .= " WHERE " . TABLE_PREFIX . "erc_artistmbr.artistid = '$getartistid'";
}
$sql .= " ORDER BY " . TABLE_PREFIX . "erc_artist.artisttitle, erc_artistmbr.displayorder";
$artistmbrs = $db->query_read($sql);
![]() Thanks! |
|
#2
|
||||
|
||||
|
PHP Code:
|
|
#3
|
||||
|
||||
|
thanks jumpd, works nicely in that instance, however for another situation, I am having problems using the cleaner class within a foreach loop...
My current code: PHP Code:
What i tried that didn't work: PHP Code:
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|