使用一个查询从mysql中获取多行并在php中使用它们

时间:2022-04-12 01:31:51

Hi there i got stuck on this code and i don't seem to find a solution to it. I have this now... pdf download

嗨,我坚持这个代码,我似乎没有找到解决方案。我现在有这个... pdf下载

and i want to display this... enter image description here

我想显示这个...在这里输入图像描述

all the PDFs are in a table and one product have 2-3 PDFs here is my code: enter image description here

所有的PDF都在一个表格中,一个产品有2-3个PDF格式,这里是我的代码:在这里输入图像描述

and the table looks like this... enter image description here

并且表格如下所示...在此处输入图像说明

1 个解决方案

#1


0  

Sorry for not placing the code: here is the code i speak and the images is for a visual aspect of what i want the code to do...

很抱歉没有放置代码:这是我说的代码,图片是我希望代码做的视觉方面......

<?php 
$data_sheet = false;
$datasheet_query = $db->Execute("SELECT TECHLINK_ID, TECHLINK_INCODE, TECHLINK_URLID, TECHLINK_products_id, TECH_URL, TECH_TITLE
                                FROM FTECHLINK
                                LEFT JOIN FTECHSHEET_URL ON TECH_ID = TECHLINK_URLID
                                WHERE TECHLINK_products_id = ".(int)$_GET['products_id']."");
if (!$datasheet_query->EOF){
    $data_sheet = true;
    $pdf_title = $datasheet_query->fields['TECH_TITLE'];
    $pdf_file = $datasheet_query->fields['TECH_URL'];
    $pdf_path = "acrobat/".$pdf_file;
    $image_name = str_ireplace('.pdf','.jpg',$pdf_file);
    $image_path = "acrobat/".$image_name;
    $tech_image = '<div class="download_image_container"><a href="' . $pdf_path . '"target="_blank">' . zen_image($image_path, $products_name, "173", "245", 'class="box_image_pdf"') . '</a></div>';
    $tech_title = '<div class="download_title_container"><a class="document_title"href="' . $pdf_path . '"target="_blank">' . $pdf_title . '</a></div>';
}
?>


     <?php if ($data_sheet == true) { ?>
        <div id="datasheet" class="tab-pane">
            <div class="product-tab">
            <?php 
                echo $tech_image;
                echo $tech_title;
            ?>
            </div>
        </div>

#1


0  

Sorry for not placing the code: here is the code i speak and the images is for a visual aspect of what i want the code to do...

很抱歉没有放置代码:这是我说的代码,图片是我希望代码做的视觉方面......

<?php 
$data_sheet = false;
$datasheet_query = $db->Execute("SELECT TECHLINK_ID, TECHLINK_INCODE, TECHLINK_URLID, TECHLINK_products_id, TECH_URL, TECH_TITLE
                                FROM FTECHLINK
                                LEFT JOIN FTECHSHEET_URL ON TECH_ID = TECHLINK_URLID
                                WHERE TECHLINK_products_id = ".(int)$_GET['products_id']."");
if (!$datasheet_query->EOF){
    $data_sheet = true;
    $pdf_title = $datasheet_query->fields['TECH_TITLE'];
    $pdf_file = $datasheet_query->fields['TECH_URL'];
    $pdf_path = "acrobat/".$pdf_file;
    $image_name = str_ireplace('.pdf','.jpg',$pdf_file);
    $image_path = "acrobat/".$image_name;
    $tech_image = '<div class="download_image_container"><a href="' . $pdf_path . '"target="_blank">' . zen_image($image_path, $products_name, "173", "245", 'class="box_image_pdf"') . '</a></div>';
    $tech_title = '<div class="download_title_container"><a class="document_title"href="' . $pdf_path . '"target="_blank">' . $pdf_title . '</a></div>';
}
?>


     <?php if ($data_sheet == true) { ?>
        <div id="datasheet" class="tab-pane">
            <div class="product-tab">
            <?php 
                echo $tech_image;
                echo $tech_title;
            ?>
            </div>
        </div>