Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用RedBean php连接到数据库时出现问题_Php_Mysql_Database_Redbean - Fatal编程技术网

使用RedBean php连接到数据库时出现问题

使用RedBean php连接到数据库时出现问题,php,mysql,database,redbean,Php,Mysql,Database,Redbean,我使用带有RedBean PHP的开放式服务器。连接到数据库后,当我尝试创建表时,出现错误: Fatal error: Uncaught exception 'PDOException' with message 'Could not connect to database (sots).' in C:\Users\george\OSPanel\domains\divinehunt.com\rb.php:1011 Stack trace: #0 C:\Users\george\OSPane

我使用带有RedBean PHP的开放式服务器。连接到数据库后,当我尝试创建表时,出现错误:

Fatal error: Uncaught exception 'PDOException' with message 'Could not connect to database (sots).' 
in C:\Users\george\OSPanel\domains\divinehunt.com\rb.php:1011 
Stack trace: 
#0 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(735): RedBeanPHP\Driver\RPDO->connect() 
#1 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(1035): RedBeanPHP\Driver\RPDO->runQuery('show tables', Array) 
#2 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(1056): RedBeanPHP\Driver\RPDO->GetAll('show tables', Array) 
#3 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(4183): RedBeanPHP\Driver\RPDO->GetCol('show tables', Array) 
#4 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(6652): RedBeanPHP\Adapter\DBAdapter->getCol('show tables') 
#5 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(5857): RedBeanPHP\QueryWriter\MySQL->getTables() 
#6 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(8912): RedBeanPHP\QueryWriter\AQueryWriter->tableExists('acounts') 
#7 C:\Users\george\OSPanel\domains\divinehunt.com\rb.php(9014): Re in C:\Users\george\OSPanel\domains\divinehunt.com\rb.php on line 1011
在此脚本中,我将redbean和连接到数据库:

<?php
require "rb.php";   

R::setup( 'mysql:host=localhost;dbname=sots',
        'mysql ', 'mysql' );
 ?>

单击表单中的按钮时,将执行该按钮:

<?php session_start(); require_once "db.php";
> 
> $data=$_POST; if (isset($data['do_regis'])) {
>     $user= R::dispense('acounts');
>     $user->login=$data['login'];
>     R::store($user);
>     $dir=$data['login'];
>     if (is_dir($dir)==false) {
>       mkdir('Accounts/'.$dir);
>       mkdir('Accounts/'.$dir.'/Postes');
>       mkdir('Accounts/'.$dir.'/Photos');
>     }
> 
> }
> ?>


您曾经解决过这个问题吗?您曾经解决过这个问题吗?