InnoDB 2 MyISAM PHP

Source: Internet
Author: User

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 = "account number";

$dbPass = "Password";

$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 and 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; " );

}

?>

Invoke page

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 = "account number";

$dbPass = "Password";

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 and 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 = "account Number";
  7. $dbPass = "password";
  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 and 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. Invoke page
  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 = "account Number";
  31. $dbPass = "password";
  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 and loop to convert all tables to MyISAM
  39. while ($row = Mysql_fetch_array ($result)) {
  40. Echo '. $row [0]. '
    ';
  41. }
  42. ?>
Copy Code
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.