if(get_magic_quotes_gpc()==1){
?>
MySQL Universal Query Program Note that this program needs to set magic_quotes_gpc
in the PHP configuration file (php3.ini for PHP3, php.ini for PHP4) to Off or 0. Please restart Apache after modification.
exit();
}
set_magic_quotes_runtime(0);
$host = 'localhost';
$db = 'test';
$user = 'test';
$pass = '';
// [ php/inc/str2url.php ] cvs 1.2
function str2url( $path){
return eregi_replace("%2f","/",urlencode($path));
}
?>
MySQL Universal Query Program if($cmd){
$con = mysql_pconnect($host,$user,$pass) or die('Unable Connect to '.$host.'server');
mysql_select_db($db,$con) or die('Unable to connect to '.$db.'database');
$rst = mysql_query($sql,$ con) or die($sql.'Error');
if($cmd=='query'){
$num_fields = mysql_num_fields($rst);
echo '
';
echo '
';
echo ''.$sql.'< /option>';
echo '';
for($i=0;$i<$num_fields;$i++) echo ' '.mysql_field_name($rst,$i ).' | ';
echo '
';
while($row=mysql_fetch_row($rst)){
> for($i=0;$i<$num_fields;$i++) echo ' '.$row[$i].' | ';
echo ' ';
}
echo '
';
mysql_free_result($rst);
}
else echo 'There are '.mysql_affected_rows($con).' rows affected ';
}
?>
http://www.bkjia.com/PHPjc/318050.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/318050.htmlTechArticleif(get_magic_quotes_gpc()==1){ ? html headtitleMySQL universal query program/title/head body Pay attention to this program You need to set magic_quotes_gpc in the PHP configuration file (PHP3 is php3.ini, PHP4 is php.ini)...