dsgwdigu84950 2016-06-29 04:42
浏览 37

如何在搜索引擎中检索图像?

Thanks in advance.

I am stuck I have created a generic search engine by Nick Frost. However, I am lost on how to retrieve images from it, as it keeps coming back with errors whenever I add an image as part of the $row or add the HTML image source code.

Have I done something wrong?

My code is below:

 if ($numrows > 0)      
    {
        while ($row = mysql_fetch_assoc($query))
            {
            $id = $row ['id'];
            $title = $row ['title'];
            $description = $row ['description'];
            $keywords = $row ['keywords'];
            $link = $row ['link'];
            $image = $row['images'];


            echo 
            "<nav class='table'>

                    <img src= width='50px' height='80px' 'data:image; base 64, $image'>

                    <br>

                    <a href='$link'> $title</a>

                    <br>

                    $description

                    <br>

            </nav> ";
    }
  • 写回答

1条回答 默认 最新

  • duanfei8149 2016-06-29 05:01
    关注

    Replace:

    echo "<nav class='table'>
    
                    <img src= width='50px' height='80px' 'data:image; base 64, $image'>
    
                    <br>
    
                    <a href='$link'> $title</a>
    
                    <br>
    
                    $description
    
                    <br>
    
            </nav> ";
    

    With:

    echo "<nav class='table'>
    
                    <img src='data:image; base 64, ".$image."' width='50px' height='80px'>
    
                    <br>
    
                    <a href='$link'> $title</a>
    
                    <br>
    
                    $description
    
                    <br>
    
            </nav> ";
    
    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch