Stuff
public text v1 · immutable function db_to_superglobal($superglobal, $table, $cond)
{
if ( ($superglobal == "GET" || $superglobal == "POST" || $superglobal != "SESSION") && !empty($table) )
{
if ( !empty($cond) ) $wheretxt = " WHERE " . $cond;
$sql = "SELECT * FROM " . $table . $wheretxt;
$result = mysql_query($sql);
$rec = mysql_fetch_assoc($result);
foreach ( $rec as $key=>$val )
{
${'_' . $superglobal}[$key] = $val;
}
}
}