如何在MySQL中存储图片位置?
最佳答案
您只需将其存储在 varchar
字段中,因为该位置是纯文本。然后,您将使用 PHP 在该语言环境中获取图像,如下所示:
$res = mysql_query("select imgLocation from table where id = 1");
if ($res)
{
$row = mysql_fetch_row($res);
$imgLocation = $res[0];
echo '<img src="' . $imgLocation . '" border=0 />';
}
关于php - 使用 MySQL 和 PHP 存储图像位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1137991/