Home Backend Development PHP Tutorial 从数据库读取二进制图片显示有关问题

从数据库读取二进制图片显示有关问题

Jun 13, 2016 am 10:26 AM
mssql quot

从数据库读取二进制图片显示问题
$conn=mssql_connect("192.168.1.70","XXX","123") or die("数据库打开出错");
mssql_select_db("XXX");
mssql_query("set names utf8");

$sql = "SELECT top 1 * FROM sync_info_BlogPic";

$result2=mssql_query($sql);
header("Content-Type: image/jpg");
$row2=mssql_fetch_object($result2);

echo $row2->BlogPic_Content;



error:Image corrupt or truncated



------解决方案--------------------
错误:图像损坏或截断

你是用什么类型字段保存图片的?
------解决方案--------------------
怎么读不重要,怎么存的?
------解决方案--------------------
肯定是入库出问题了, 别想了.
------解决方案--------------------
php 提供给 mssql 的缓冲区可能偏小了
------解决方案--------------------
php.ini

[MSSQL]
; Valid range 0 - 2147483647. Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647. Default = 4096.
;mssql.textsize = 4096

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to connect php to mssql database How to connect php to mssql database Oct 23, 2023 pm 12:02 PM

Methods for php to connect to mssql database include using PHP's MSSQL extension, using PDO, etc. Detailed introduction: 1. Use PHP's MSSQL extension method to ensure that PHP has the MSSQL extension installed. You can check whether the mssql extension is enabled in the PHP configuration file (php.ini); 2. Use the PDO method to ensure that PHP has the PDO extension installed. You can check whether the pdo_sqlsrv extension is enabled in the PHP configuration file (php.ini).

Detailed guide to install PHP and configure MSSQL connection on Ubuntu Detailed guide to install PHP and configure MSSQL connection on Ubuntu Feb 29, 2024 am 11:15 AM

Ubuntu is a popular open source operating system commonly used to run servers. Installing PHP and configuring MSSQL connections on Ubuntu is one of the operations that many developers and system administrators often need to do. This article will provide readers with a detailed guide, including the steps to install PHP, set up Apache, install MSSQLServer, etc., and attach specific code examples. Step 1: Install PHP and related extensions First, we need to install PHP and related extensions to support PHP connections

Detailed steps to install PHP to support MSSQL database in Ubuntu environment Detailed steps to install PHP to support MSSQL database in Ubuntu environment Feb 29, 2024 am 10:39 AM

Detailed steps for installing PHP to support MSSQL database in Ubuntu environment. When developing web applications, you often encounter situations where you need to connect to the Microsoft SQL Server (MSSQL) database. In the Ubuntu environment, to connect PHP to the MSSQL database, you need to install relevant software and configure appropriate settings. Next, we will introduce in detail the steps to install PHP to support MSSQL database in Ubuntu environment and provide specific code.

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

Complete tutorial on installing PHP and connecting to MSSQL database under Ubuntu Complete tutorial on installing PHP and connecting to MSSQL database under Ubuntu Feb 29, 2024 am 11:18 AM

Installing PHP and connecting to MSSQL database under the Ubuntu operating system is one of the skills that many developers and system administrators need to master. This article will provide a detailed tutorial, including installing PHP, installing the MSSQL server driver, configuring PHP to connect to the MSSQL database, and providing corresponding code examples. Part One: Install PHP First, we need to install PHP and related extensions to be able to connect to the MSSQL database. Enter the following command in the terminal to install PHP and necessary extensions

An example analysis of mssql injection + whitelist upload to bypass 360 An example analysis of mssql injection + whitelist upload to bypass 360 May 12, 2023 pm 02:37 PM

Information collection: The site is built using vue+aspx+iis8.5. The site login box has a version number and the word siteserver exists in the URL column, so it is suspected that it was built by cms, but I have not seen the cms. Using Google search, I found that the site was built with siteserver cms, the version is the latest, and the vulnerability provided on the Internet is This cannot be used. I tried injection + weak password + verification code bypass + unauthorized and other methods in the login box to no avail. Since I have a test account, I simply log in to the site directly for testing. The picture is the login picture I found online. The red box was the version number instead of the cms prompt. Functional test: After entering the background, I briefly browsed the functions, mostly for page management.

How to install php mssql on ubuntu How to install php mssql on ubuntu Jan 28, 2023 am 09:25 AM

How to install php mssql on ubuntu: 1. Enter the terminal command window; 2. Execute "curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/ mssql-release.list"; 3. Install "pdo_sqlsrv" through the install command.

Example analysis of MSSQL backdoor from Winnti hacker group Example analysis of MSSQL backdoor from Winnti hacker group May 27, 2023 pm 09:04 PM

For some time, ESET researchers have been tracking the activities of Winnti, a group that has been active since 2012 and has targeted the video game and software industry supply chains. Recently, a previously undocumented backdoor was discovered that targets Microsoft SQL (MSSQL). This backdoor bears many similarities to the PortReuse backdoor, another tool used by WinntiGroup and first documented in October 2019. This year, a new backdoor sample, skip-2.0, was detected. The author is a member of the winnti organization. This backdoor targets MSSQL Server 11 and 12 and allows attackers to use magi

See all articles