小编use*_*425的帖子

Php longblob to img

我有一个函数调用数据库类,并要求一个图像列表.以下是该功能.

//Hämtar en array av filer från disk.
public function GetFiles()
{   

    $sql = "SELECT pic FROM pictures";
    $stmt = $this->database->Prepare($sql);

    $fileList = $this->database->GetAll($stmt);
    echo $fileList;
    if($fileList)
    {
        return $fileList;
    }
    return false;
}
Run Code Online (Sandbox Code Playgroud)

这是GetFiles调用的数据库类方法.

public function GetAll($sqlQuery) {

        if ($sqlQuery === FALSE)
        {
            throw new \Exception($this->mysqli->error);
        }
        //execute the statement
        if ($sqlQuery->execute() == FALSE)
        {
            throw new \Exception($this->mysqli->error);
        }
        $ret = 0;
        if ($sqlQuery->bind_result($ret) == FALSE)
        {
            throw new \Exception($this->mysqli->error);
        }

        $data = array();
        while ($sqlQuery->fetch())
        {
            $data[] = …
Run Code Online (Sandbox Code Playgroud)

php database

3
推荐指数
1
解决办法
5733
查看次数

xml错误xsl样式表

我有以下错误

第40行第1行的错误:文档末尾的额外内容

当尝试输出xml文件时:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="producers.xsl"?>
<producers>
  <producer>
    <id>8</id>
    <name>Emåmejeriet</name>
    <street>Grenvägen 1-3</street>
    <postal>577 39</postal>
    <city>Hultsfred</city>
    <weburl>http://www.emamejerie3t.se</weburl>
  </producer>
</producers>
Run Code Online (Sandbox Code Playgroud)

我已经验证了xml,我没有错误.xsl模板看起来像这样

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
    <head><title>Producenter</title></head>
    <body>
        <p>
            <xsl:value-of select="producers/producer/id"/>
        </p>
    </body>
</xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

php xml xslt

3
推荐指数
1
解决办法
3602
查看次数

调用未定义的函数sqlite_libversion()

我真的不能理解为什么我得到这个错误,我有

extension=php_sqlite.dll
extension=php_sqlite3.dll
Run Code Online (Sandbox Code Playgroud)

我正在使用php版本5.4.3的wamp

我得到以下错误调用未定义的函数sqlite_libversion()

我有代码

 echo sqlite_libversion();
Run Code Online (Sandbox Code Playgroud)

我已经尝试过其他论坛和线程,但所有这些都是关于忘记启用模块,为什么我仍然有问题?

php sqlite

2
推荐指数
1
解决办法
4539
查看次数

标签 统计

php ×3

database ×1

sqlite ×1

xml ×1

xslt ×1