innodb 2 myisam php

WBOY
Lepaskan: 2016-07-25 09:02:18
asal
1098 orang telah melayarinya

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


Label berkaitan:
sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan