Home > Backend Development > PHP Tutorial > MySQL Universal Query Program_PHP Tutorial

MySQL Universal Query Program_PHP Tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:31:35
Original
991 people have browsed it

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

MySQL<font class="reblank">(The best combination with PHP)</font> General query program

Note that this program requires php(as the current mainstream development language)configuration file (php(As the current mainstream development language)3.php(As the current mainstream development language)3.ini,php(As the current mainstream development language)4 is set magic_quotes_gpc in php(as the current mainstream development language)
.ini) to Off or 0. After modification, please restart apache(the most popular WEB on Unix platform Server platform).


exit();
}

set_magic_quotes_runtime(0) ;

$host = localhost;
$db = test;
$user = test;
$pass = ;

// [php(do As the current mainstream development language)/inc/str2url.php(As the current mainstream development language) ] cvs 1.2
function str2url($path){
return eregi_replace( "/","/",urlencode($path));
}
?>


MySQL<font class="reblank"> (The best combination with PHP)</font>Universal query program



Please enter the SQL statement:







if($cmd){
$con = MySQL(The best combination with PHP)_pconnect($host,$user,$pass) or die(Unable to connect to .$host.server) );
MySQL(The best combination with PHP)_select_db($db,$con) or die (Unable to connect to .$db.database);
$rst = MySQL(The best combination with PHP)_query($sql,$con) or die($sql.error);
if($cmd==query){
$num_fields = MySQL(The best combination with PHP)_num_fields($rst);
echo
;
echo ;
 echo ;
for($i=0;$i< $num_fields;$i++) echo ;
echo < ;/tr>;
while($row=MySQL(The best combination with PHP)_fetch_row($rst)){
echo ;
for( $i=0;$i<$num_fields;$i++) echo ;
    echo ;
  }
echo
.$sql.;
 echo
 .MySQL(The best combination with PHP)_field_name($rst,$i).
 .$row[$i].
;
MySQL(The best combination with PHP)_free_result($rst);
}
else echo Yes.MySQL( The best combination with PHP)_affected_rows($con). Rows affected;
}
?>







www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509049.htmlTechArticleif(get_magic_quotes_gpc()==1) ? html headtitleMySQL (the best combination with PHP) universal query program /title/head body Note that this program requires PHP (as the current mainstream development language) to be configured...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template