简体   繁体   中英

How to insert rows into a mysql db?

I need to write a script to be used an automated test to constantly insert rows into a mysql db. Which scripting language is best suited for this?

I'm using php to read the db and create html. Does it makes sense to use PHP for this too? Or would I be better off using ruby, or some other mechanism?

Learn how to use MySql Stored Procedures. And AFAIK, PHP was built to generate HTML from start. Any noticeable performance problems should probably arise from your knowledge of html.

You can use phpadmin, toad, or any other MySql IDE to run the script:

BEGIN
  LOOP
    INSERT INTO ...
  END LOOP;
END;

看起来我应该只从cmd行使用php,这显然是可能的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM