Home Backend Development PHP Tutorial A simple MySQL data browser_PHP tutorial

A simple MySQL data browser_PHP tutorial

Jul 21, 2016 pm 04:04 PM
mysql Revise Can you data Browse Browser of program Simple this

This program can be used to browse data in MySQL. You can make a very good MySQL browser with a few modifications.
*/

/*
?cmd=db
?cmd=table&db={}
?cmd=record&db={}&table={}
*/

$host = 'localhost';
$user = 'test';
$password = '';

if(!isset($cmd)) $cmd = 'db';
switch($cmd){
case 'db':
break;
case 'table':
break;
case 'record':
break;
default:
$cmd = 'db';
break;
}

$con = @mysql_connect($host,$user,$password) or die('Unable to connect'.$host);

switch($cmd){
case 'db':
$dbs = mysql_list_dbs($con) or die('mysql_list_dbs Error:'.$php_errmsg);
echo 'databases on '.$host.':
'.chr (13);
$num_rows = mysql_num_rows($dbs);
for($i=0;$i<$num_rows;$i++){
$db = mysql_tablename($dbs,$i) ;< ;br>'.chr(13);
}
mysql_free_result ($dbs); ) or die ('MySQL_LIST_TABLES error:'.
$ php_errmsg);
Echo 'Tables on'. $ db. 'of'. $ host. 🎜> $num_rows = mysql_num_rows($tables);
for($i=0;$i<$num_rows;$i++){
$table = mysql_tablename($tables,$i);
echo '                                                                                                                                                                 
'.
                                                                                                                                                                  PHP_SELF.'?cmd=db">show databases'.chr(13);
break;
case 'record':
$records = mysql_db_query($db,'select * from '.$table,$con) or
     die('mysql_db_query error:'.$php_errmsg);
  echo 'records on '.$table.':
'.chr(13);
echo '

'.chr(13);
echo ''.chr(13);
$num_fields = mysql_num_fields($records);
for($i=0;$i<$num_fields;$i++)
echo ''.chr(13);
    echo ''.chr(13);
   while($row=mysql_fetch_row($records)){
    echo '< ;tr>'.chr(13);
for($i=0;$i<$num_fields;$i++)
echo ''.chr(13);
  }
echo '
'.mysql_field_name($records,$i).'
'.$row[$i].'< /td>'.chr(13);
    echo '
'.chr(13);
mysql_free_result($records);
echo '
show databases
                                                                    a>'.chr(13);
break;
}

mysql_close($con) or die('Unable to disconnect from '.$host.');
?>



http://www.bkjia.com/PHPjc/316005.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316005.htmlTechArticleThis program can be used to browse data in MySQL. You can make a very good MySQL with a few modifications. Browser. */ /* ?cmd=db ?cmd=tabledb={} $user = 'test'; $password = ''; if(!iss...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Explain the purpose of foreign keys in MySQL. Explain the purpose of foreign keys in MySQL. Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Can two exchanges convert coins to each other? Apr 22, 2025 am 08:57 AM

Can. The two exchanges can transfer coins to each other as long as they support the same currency and network. The steps include: 1. Obtain the collection address, 2. Initiate a withdrawal request, 3. Wait for confirmation. Notes: 1. Select the correct transfer network, 2. Check the address carefully, 3. Understand the handling fee, 4. Pay attention to the account time, 5. Confirm that the exchange supports this currency, 6. Pay attention to the minimum withdrawal amount.

How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial How to register an account on Ouyi Exchange Ouyi Exchange Registration Tutorial Apr 24, 2025 pm 02:06 PM

The steps to register an Ouyi account are as follows: 1. Prepare a valid email or mobile phone number and stabilize the network. 2. Visit Ouyi’s official website. 3. Enter the registration page. 4. Select email or mobile phone number to register and fill in the information. 5. Obtain and fill in the verification code. 6. Agree to the user agreement. 7. Complete registration and log in, carry out KYC and set up security measures.

How does MySQL differ from Oracle? How does MySQL differ from Oracle? Apr 22, 2025 pm 05:57 PM

MySQL is suitable for rapid development and small and medium-sized applications, while Oracle is suitable for large enterprises and high availability needs. 1) MySQL is open source and easy to use, suitable for web applications and small and medium-sized enterprises. 2) Oracle is powerful and suitable for large enterprises and government agencies. 3) MySQL supports a variety of storage engines, and Oracle provides rich enterprise-level functions.

What is on-chain transaction? What are the global transactions? What is on-chain transaction? What are the global transactions? Apr 22, 2025 am 10:06 AM

EU MiCA compliance certification, covering 50 fiat currency channels, cold storage ratio 95%, and zero security incident records. The US SEC licensed platform has convenient direct purchase of fiat currency, a ratio of 98% cold storage, institutional-level liquidity, supports large-scale OTC and custom orders, and multi-level clearing protection.

Tips and recommendations for the top ten market websites in the currency circle 2025 Tips and recommendations for the top ten market websites in the currency circle 2025 Apr 22, 2025 am 08:03 AM

Domestic user adaptation solutions include compliance channels and localization tools. 1. Compliance channels: Franchise currency exchange through OTC platforms such as Circle Trade, domestically, they need to go through Hong Kong or overseas platforms. 2. Localization tools: Use the currency circle network to obtain Chinese information, and Huobi Global Station provides a meta-universe trading terminal.

Binance download link Binance download path Binance download link Binance download path Apr 24, 2025 pm 02:12 PM

To safely download the Binance APP, you need to go through the official channels: 1. Visit the Binance official website, 2. Find and click the APP download portal, 3. Choose to scan the QR code, app store, or directly download the APK file to download to ensure that the link and developer information are authentic, and enable two-factor verification to protect the security of the account.

How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange How to register an account on Sesame Open Exchange? Tutorial on Registration of Sesame Open Exchange Apr 24, 2025 pm 02:00 PM

Registering a Sesame Door Account requires 7 steps: 1. Prepare a valid email or mobile phone number and a stable network; 2. Visit the official website; 3. Enter the registration page; 4. Select and fill in the registration method; 5. Obtain and fill in the verification code; 6. Agree to the user agreement; 7. Complete registration and log in, it is recommended to carry out KYC and set security measures.

See all articles