Clear MySQLSQL database code

Source: Internet
Author: User

The following articles mainly introduce how to clear the code of MySQLSQL database _ php to clear mysql asp. This article mainly describes detailed analysis of access or mssql: 34asp code, I hope it will help you in this regard.

Copy the Code as follows:

 
 
  1. <%   
  2. Dim Rs,Conn   
  3. Set Conn=Server.CreateObject("Adodb.Connection")   
  4. Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("readlog.mdb")   
  5. Set Rs=Conn.OpenSchema(20)   
  6. Do While not Rs.Eof   
  7. If Ucase(Rs("TABLE_TYPE"))="TABLE" Then ' 

For user tables

 
 
  1. Conn. Execute ("Drop Table" & Rs ("TABLE_NAME ")&"")
  2. End If
  3. Rs. MoveNext
  4. Loop
  5. Response. Write "successful! "
  6. Rs. Close
  7. Set Rs = Nothing
  8. Conn. Close
  9. Set Conn = Nothing
  10. %>

Php clears mysql

MySQLSQL database; copy the Code as follows:

 
 
  1. <? Php
  2. $ User = "readlog.cn"; // account
  3. $ Password = "readlog.cn"; // password
  4. $ Dbname = "readlog"; // Database
  5. $ Link = mysql_connect ("localhost: 3306", $ user, $ password );
  6. Mysql_select_db ("$ dbname", $ link );
  7. Echo "<p> clearing database ...";
  8. $ Result = mysql_query ("SHOW tables", $ link );
  9. While ($ currow = mysql_fetch_array ($ result ));
  10. Mysql_query ("drop table if exists $ currow [0]");
  11. Echo "successful! ";
  12. ?>

Asp clear mssql

Copy the Code as follows:
 

 
 
  1. <%
  2. Dim Rs, Conn
  3. Set Conn = Server. CreateObject ("Adodb. Connection ")
  4. Conn. Open "Provider = Sqloledb; User ID = readlog.cn; Password = readlog.cn; Initial Catalog = readlog; Data Source = (local );"
  5. Set Rs = Conn. Execute ("Select name from sysobjects Where xtype = char (85) order by id ")
  6. Do While Not Rs. Eof
  7. Conn. Execute ("drop table" & rs (0 )&"")
  8. Rs. movenext
  9. Loop
  10. Response. Write "successful! "
  11. Rs. Close
  12. Set Rs = Nothing
  13. Conn. Close
  14. Set Conn = Nothing
  15. %>

The above content is an introduction to clearing the code of the MySQLSQL database.

Related Article

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.