简体   繁体   中英

How to use a record from a “echo” of a array to use into another php select

I am trying to get a record from an "printed" array. I have this code:

while($row=mysqli_fetch_array($result,MYSQLI_BOTH)){
            echo "<tr><td class=\"normal\" width=\"25%\"><font face=\"verdana\">" . 
                $row["Title"] . "</font></td>";
            echo "<td class=\"normal\" width=\"25%\"><font face=\"verdana\">" . 
                $row["Visor"] . "</font></td>";
            echo "<td class=\"normal\" width=\"25%\"><font face=\"verdana\">" . 
                convertirUrls ($row["URL"]) . "</font></td>";
            echo "<td class=\"normal\" width=\"25%\"><font face=\"verdana\">" . 
                $row["Name"] . "</font></td>";
            }

I would like to transform one record of this table in a link to generate another "query". So how can I get one record into a $variable?

You can use this

<?

    while($row= mysqli_fetch_array($result,MYSQLI_BOTH))
    {
        ?>

        <tr>
            <td class="normal" width="25%"><font face="verdana"><?php echo $row["Title"] ?></font></td>
            <td class="normal" width="25%"><font face="verdana"><?php echo $row["Visor"] ?></font></td>
            <td class="normal" width="25%"><font face="verdana"><?php echo convertirUrls($row["URL"]) ?></font></td>
            <td class="normal" width="25%"><font face="verdana"><?php echo $row["Name"] ?></font></td>
        </tr>
    <?php
    }

Note: HTML <font> Tag. Not Supported in HTML5.

assign single data to variable

<?php

    $title =  $row["Title"] ;
    echo $title;

?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM