我想编写PHP代码嵌入到Drupal7模块中。
我想调用一个过程,它可以将本地MySQL数据库中新生成的数据复制到远程MySQL数据库中。
当数据插入本地数据库的表A中时,应将其复制到远程MySQL数据库上的特定表B中。
Table 'A' is on local host.
Table 'B' is on remote server.
INSERT data on 'A' -> copied to 'B'
这个是可能的吗?
如何使用query重命名MySQL数据库名称?
我通过phpmyadmin尝试了rename数据库,得到了以下错误:
SQL query:
RENAME DATABASE test TO test_bkp
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE test To test_bkp&
基本上,它会进入数据库,在数据库中找到与我输入的单词相匹配的单词,并发出一个回复,这是可行的,但它做了所有其他的废话。
这是我的PHP代码
<?php
// Connect to database
mysql_connect("*****", "***", "****");
mysql_select_db("***");
// If something is received
if($_POST)
{
if($_POST['action']