PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

php实现的MySQL通用查询程序_PHP教程

原创
2016-07-21 15:56:37 519浏览

if(get_magic_quotes_gpc()==1){
?>

MySQL通用查询程序

注意本程序需要将PHP配置文件(PHP3为php3.ini,PHP4为php.ini)中的magic_quotes_gpc
设成Off或0,修改后请重新启动Apache.



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","//m.sbmmt.com/m/",urlencode($path));
}
?>

MySQL通用查询程序

" method="post">
请输入SQL语句:







if($cmd){
$con = mysql_pconnect($host,$user,$pass) or die('无法连接'.$host.'服务器');
mysql_select_db($db,$con) or die('无法连接'.$db.'数据库');
$rst = mysql_query($sql,$con) or die($sql.'出错');
if($cmd=='查询'){
$num_fields = mysql_num_fields($rst);
echo '
';
echo '';
echo '';
for($i=0;$i '.mysql_field_name($rst,$i).'';
echo '';
while($row=mysql_fetch_row($rst)){
echo '';
for($i=0;$i '.$row[$i].'';
echo '';
}
echo '
'.$sql.'';
echo '
';
mysql_free_result($rst);
}
else echo '有 '.mysql_affected_rows($con).' 行受影响';
}
?>


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/318050.htmlTechArticleif(get_magic_quotes_gpc()==1){ ? html headtitleMySQL通用查询程序/title/head body 注意本程序需要将PHP配置文件(PHP3为php3.ini,PHP4为php.ini)中的magic_quotes_gpc 设...
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。