简体   繁体   English

设置MySQL数据库

[英]Setting up MySQL database

I do have single database and near about 11 tables. 我确实有一个数据库,大约有11个表。 while my web page is opening informations from these 11 tables will be accessed same time. 当我的网页打开时,将同时访问这11个表中的信息。 according to my current settings what I did now is for each table database is opening and closing. 根据我当前的设置,我现在正在打开和关闭每个表数据库。 say I had given username and password to open databse for each table and close after retrieving information from that table. 说我已经给了用户名和密码来打开每个表的数据库,并在从该表中检索信息后关闭。

Is this the right way to do it?? 这是正确的方法吗? I feel because of this the database is opeing and closing 11 times!!!! 因此,我感到数据库正在运行并关闭11次! Am I right?? 我对吗?? is this the right way to do that?? 这是正确的方法吗?

Oh well I do have some tables which update date is differ from others... THanks 哦,我确实有一些更新日期与其他日期不同的表格...

Mathew 马修

Since the tables are in the same database, it's not necessary to keep closing and re-opening the database. 由于这些表位于同一数据库中,因此不必保持关闭状态并重新打开数据库。 Use mysql_connect the first time, and then subsequent calls to eg mysql_query will reutilize that same connection, if you don't provide a new one. 第一次使用mysql_connect ,然后,如果不提供新的连接,则对mysql_query的后续调用将重新利用该连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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