我正在尝试检索存储在数据库中的图像..我只是想在我尝试显示图像之前立即打印图像的名称,这样我才能在这方面做得更好...... < / p>
现在我有一个名为categories的表,其字段为categories_id,categories_image
这是我在php中的查询:
<?php
$category_image_raw = "select c.categories_image from categories c where c.categories_id in(41)";
echo $category_image_raw['categories_image']; ?>
字段category_id 41上传了一张图片。这不起作用。我错过了什么?
答案 0 :(得分:1)
<?php
$category_image_sql = "select c.categories_image from categories c where c.categories_id = 41;";
$category_image_query = mysql_query($category_image_sql);
$category_image_raw = mysql_fetch_array($category_image_query);
echo $category_image_raw['categories_image'];
?>
请记得先登录mysql。