[英]How can I Create a CMS using php where end user doesn't have to know anything about database. Is that possible
In genera sense if I create a CMS using php .Where I created and named the database in my localhost. 从一般意义上讲,如果我使用php创建CMS。我在本地主机中创建并命名数据库的位置。 Now if I or my clent upload the CMS in any server how will it work. 现在,如果我或我的客户在任何服务器上上传CMS,它将如何工作。 because there is no database in that server. 因为该服务器中没有数据库。
And in my php code I wrote to create database. 在我的php代码中,我编写了创建数据库的代码。 Now how can i create a CMS which can automatically create database and tables where client doesn't have to know about anything besides uploading the CMS. 现在,我该如何创建一个CMS,该CMS可以自动创建数据库和表,而客户端除了上载CMS外无需了解其他任何信息。
Example: In the CMS there is a query saying (SELECT * FROM users). 示例:在CMS中,有一个查询(SELECT * FROM users)。 I named the table users which contains user information. 我将包含用户信息的表命名为users。
but If a client upload my CMS into his server how will it work. 但是如果客户将我的CMS上传到他的服务器中,它将如何工作。 Does he have to go phpmyadmin and create a identical database like I created and named while developing the CMS. 他是否必须去phpmyadmin并创建一个与开发CMS时创建和命名的数据库相同的数据库。
You can create a php page that will execute some queries to create the database and tables. 您可以创建一个php页面,该页面将执行一些查询以创建数据库和表。
But I think, it would be a good choice to ask your user to create a database(blank database) and provide the details of the hostname
, database name
, database username
and database password
, to your CMS system. 但是我认为,最好是让您的用户创建一个数据库(空白数据库),并向CMS系统提供hostname
, database name
, database username
和database password
的详细信息。 So you could use this to execute the queries for creating the tables. 因此,您可以使用它来执行用于创建表的查询。 I think, that's how most of the forums and CMS softwares do. 我认为,多数论坛和CMS软件都是这样做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.