mccollin
06-01-2007, 08:33 PM
I am building a CMPS module that will let me dynamically build a page from GARS custom fields, so that I can have one page definition and generate hundreds of pages from it. I have it all working, but I need to now put in some error detection. I am passing a url value that is used to find the correct thread. If someone inputs a bogus value, then it takes me into a messy end result... here is the framework I am working with...
$device = $vbulletin->input-clean_gpc('r', 'd', TYPE_NOHTML);
$sql = "SELECT statement...
WHERE .... AND gcv.gars36 = '$device' ";
$result = $db->query_read($sql);
while ($result = $db->fetch_array($results))
{
..........
}
The value that is passed into $device is supposed to match one unique thread. If the value is bogus, nothing is found. How can I detect that I retrieved no rows and immediately redirect to another url without continuing the module?
Assuming I can do that, is there a way to also do the redirect if I return more than one row?
$device = $vbulletin->input-clean_gpc('r', 'd', TYPE_NOHTML);
$sql = "SELECT statement...
WHERE .... AND gcv.gars36 = '$device' ";
$result = $db->query_read($sql);
while ($result = $db->fetch_array($results))
{
..........
}
The value that is passed into $device is supposed to match one unique thread. If the value is bogus, nothing is found. How can I detect that I retrieved no rows and immediately redirect to another url without continuing the module?
Assuming I can do that, is there a way to also do the redirect if I return more than one row?