MYSQL ERROR:

' . mysql_error() . '

QUERY:

' . nl2br( $q ) . '

' ); return $data; } $q = "SELECT url FROM " . $GLOBALS['dbprefix'] . "_pages WHERE dbparent='0' AND status >=1 ORDER BY sortid ASC LIMIT 1 ;"; $data = query( $q ); if( mysql_num_rows( $data )==0 ){ $uri = strtolower( $_SERVER["REQUEST_URI"] ); $pos = strpos( $uri, '?' ); if ($pos !== false) { $uri = substr( $uri, 0, $pos ); } include_once( 'inc/404.php' ); exit; } else { $row = mysql_fetch_assoc( $data ); } if( $GLOBALS['mysql_persistent']!=1 ){ mysql_close(); } //die( $row['url'] ); header( 'Location: /' . $row['url'] ); exit; ?>