// Provide a way to do results with offsets
fucntion convert_result($request, $offset = 0, $field_name = '')
{
global $smcFunc;
// SQLite is a pain, This should hopefully work.
if ($smcFunc['db_title'] == 'SQLite')
{
$result = $smcFunc['db_query']('', $request, 'security_override');
$t = 0;
while ($row = sqlite_fetch_array($result))
{
if ($t != $offset)
++$t;
elseif ($field_name != '')
return $row[$field_name];
else
return $row[0];
}
}
// Luckily Postgresql is with it.
elseif ($smcFunc['db_title'] == 'PostgreSQL')
return pg_fetch_result($request, $offset, $field_name);
else
return mysql_fetch($request, $offset, $field_name);
}
// Provide a way to do results with offsets
fucntion convert_result($request, $offset = 0, $field_name = '')
{
global $smcFunc;
// SQLite is a pain, This should hopefully work.
if ($smcFunc['db_title'] == 'SQLite')
{
// Perform the query.
$result = $smcFunc['db_query']('', $request, 'security_override');
// Now loop throuh it with an array (for ease of use for field_name).
$t = 0;
while ($row = sqlite_fetch_array($result))
{
// If its not our offset, Add, and get on with it.
if ($t != $offset)
{
++$t;
continue;
}
// We want to be that lazy.. Um I mean, Specific?
if ($field_name != '')
return $row[$field_name];
else
return $row[0];
}
}
// Luckily Postgresql is with it.
elseif ($smcFunc['db_title'] == 'PostgreSQL')
return pg_fetch_result($request, $offset, $field_name);
else
return mysql_fetch($request, $offset, $field_name);
}
// Provide a way to do results with offsets
fucntion convert_result($request, $offset = 0, $field_name = '')
{
global $smcFunc;
// SQLite is a pain, This should hopefully work.
if ($smcFunc['db_title'] == 'SQLite')
{
// Perform the query.
$result = $smcFunc['db_query']('', $request, 'security_override');
// Now loop throuh it with an array (for ease of use for field_name).
$t = 0;
while ($row = sqlite_fetch_array($result))
{
// If its not our offset, Add, and get on with it.
if ($t != $offset)
{
++$t;
continue;
}
// We want to be that lazy.. Um I mean, Specific?
if ($field_name != '')
return $row[$field_name];
else
return $row[0];
}
}
// Luckily Postgresql is with it.
elseif ($smcFunc['db_title'] == 'PostgreSQL')
return pg_fetch_result($request, $offset, $field_name);
else
return mysql_result($request, $offset, $field_name);
}