innodb 2 myisam php

WBOY
Libérer: 2016-07-25 09:02:18
original
1083 Les gens l'ont consulté

// 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. ?>
复制代码


Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal