|
|
|
ช่วยทีนะคะ การดึง BLOB จาก MySQL การดึงภาพ BLOB จาก MySQL ออกมาแสดง ต้องใช้คำสั่งอะไรบ้างคะ |
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2012-01-25 17:18:58 |
By :
5552 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
id int(11) auto_increment
images blob BINARY
ผมดึงมาแบบ Recordset แล้ว เป็นยังงี้ แก้ได้ไหมครับ
����JFIF��>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ��C $.' ",#(7),01444'9=82<.342��C
|
|
|
|
|
Date :
2014-01-23 03:07:26 |
By :
A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เอามาจาก dreamweaver อะ
Code (PHP)
<?php require_once('Connections/New.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_New, $New);
$query_Recordset1 = "SELECT * FROM images";
$Recordset1 = mysql_query($query_Recordset1, $New) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="373" border="1" align="center">
<tr>
<th width="88" scope="col"> </th>
<th width="269" scope="col"> </th>
</tr>
<tr>
<th scope="col"><?php echo $row_Recordset1['id']; ?></th>
<th scope="col"><?php echo $row_Recordset1['images']; ?></th>e
</tr>
</table>
<p> </p>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
แก้ให้ทีนะครับ
|
|
|
|
|
Date :
2014-01-23 03:22:07 |
By :
A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อ่านวิธีใช้ข้างบนก่อนครับ -*-
|
|
|
|
|
Date :
2014-01-23 07:01:45 |
By :
itpcc |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2014-01-23 09:28:34 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช้ไม่เป็นครับ งงง รับกวนทีนะครับ
|
|
|
|
|
Date :
2014-01-23 10:53:22 |
By :
A |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|