首页 > 后端开发 > php教程 > innodb 2 myisam php

innodb 2 myisam php

WBOY
发布: 2016-07-25 09:02:18
原创
1090 人浏览过

// display error is On for us to be notified if there's something wrong

ini_set ( 'display_errors', 'On' );

error_reporting ( E_ALL );

// Config, change this variables

$dbServer = "localhost";

$dbUser = "帐号";

$dbPass = "密码";

$dbName = $_GET['dbName'];

// Set a connection for our database

$link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () );

// Select our database

mysql_select_db ( $dbName, $link ) or die ( "unable to select database 'db': " . mysql_error () );

$result = mysql_query ( "show tables" );

if (! $result) {

die ( 'query failed: ' );

}

// Use while loop to convert all tables to MyISAM

while ( $row = mysql_fetch_array ( $result ) ) {

// Command Reference: ALTER TABLE tableName ENGINE=MyISAM

echo "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; ".'
';

mysql_query ( "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; " );

}

?>

调用页面

// display error is On for us to be notified if there's something wrong

ini_set ( 'display_errors', 'On' );

error_reporting ( E_ALL );

// Config, change this variables

$dbServer = "localhost";

$dbUser = "帐号";

$dbPass = "密码";

// Set a connection for our database

$link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () );

$result = mysql_query ( "show databases;" );

if (! $result) {

die ( 'query failed: ' );

}

// Use while loop to convert all tables to MyISAM

while ( $row = mysql_fetch_array ( $result ) ) {

echo '.$row[0].'">'.$row[0].'
';

}

?>



  1. // display error is On for us to be notified if there's something wrong
  2. ini_set ( 'display_errors', 'On' );
  3. error_reporting ( E_ALL );
  4. // Config, change this variables
  5. $dbServer = "localhost";
  6. $dbUser = "帐号";
  7. $dbPass = "密码";
  8. $dbName = $_GET['dbName'];
  9. // Set a connection for our database
  10. $link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () );
  11. // Select our database
  12. mysql_select_db ( $dbName, $link ) or die ( "unable to select database 'db': " . mysql_error () );
  13. $result = mysql_query ( "show tables" );
  14. if (! $result) {
  15. die ( 'query failed: ' );
  16. }
  17. // Use while loop to convert all tables to MyISAM
  18. while ( $row = mysql_fetch_array ( $result ) ) {
  19. // Command Reference: ALTER TABLE tableName ENGINE=MyISAM
  20. echo "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; ".'
    ';
  21. mysql_query ( "ALTER TABLE " . $row [0] . " ENGINE=MyISAM; " );
  22. }
  23. ?>
  24. 调用页面
  25. // display error is On for us to be notified if there's something wrong
  26. ini_set ( 'display_errors', 'On' );
  27. error_reporting ( E_ALL );
  28. // Config, change this variables
  29. $dbServer = "localhost";
  30. $dbUser = "帐号";
  31. $dbPass = "密码";
  32. // Set a connection for our database
  33. $link = mysql_connect ( $dbServer, $dbUser, $dbPass ) or die ( "unable to connect to msql server: " . mysql_error () );
  34. $result = mysql_query ( "show databases;" );
  35. if (! $result) {
  36. die ( 'query failed: ' );
  37. }
  38. // Use while loop to convert all tables to MyISAM
  39. while ( $row = mysql_fetch_array ( $result ) ) {
  40. echo ''.$row[0].'
    ';
  41. }
  42. ?>
复制代码


相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板