duan97689 2015-01-06 05:40
浏览 36

php中的数据库连接问题

I have been creating registration form using php.

And my database and table look like this:

http://imgur.com/b6JhFcd

This is the database connection query:

<?PHP
require_once("./include/fg_membersite.php");

$fgmembersite = new FGMembersite();

//Provide your site name here

//Provide the email address where you want to get notifications
$fgmembersite->SetAdminEmail('rajaselva.csc@gmail.com');

//Provide your database login details here:
//hostname, user name, password, database name and table name
//note that the script will create the table (for example, fgusers in this case)
//by itself on submitting register.php for the first time
$fgmembersite->InitDB(/*hostname*/'localhost',
                      /*username*/'root',
                      /*password*/'',
                      /*database name*/'employee',
                      /*table name*/'employee-reg');

//For better security. Get a random string from this link: http://tinyurl.com/randstr
// and put it here
$fgmembersite->SetRandomKey('qSRcVS6DrTzrPvr');

?>

After entering the input details, it shows like this,

http://imgur.com/8RETiOp

May I know, what is my mistake, how can I fix this.

Can anybody help me? thanks in advance.

  • 写回答

2条回答 默认 最新

  • doudou3716 2015-01-06 05:50
    关注

    Add back tick (``) on the employee-reg table name. Hope that will work

    $fgmembersite->InitDB(/*hostname*/'localhost',
                          /*username*/'root',
                          /*password*/'',
                          /*database name*/'employee',
                          /*table name*/'`employee-reg`');
    
    评论

报告相同问题?

悬赏问题

  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂