Problem my display data php mysql

Status
Not open for further replies.

softpk

Active Member
66
2010
1
130
Hello Friends,

i want to display date, file name and download link but i want download link in which i insert a link


i have insert download link is: http://www.yahoo.com but display record is download link show path then insert link like this: http://localhost/test2/installation report/01/. http://www.yahoo.com .


please solved this problem

My View Record Code:

PHP:
<?php
                        // connect to the database
                        include('connect-db.php');
                        
                        // get the records from the database
                        if ($result = $mysqli->query("SELECT * FROM servicereq ORDER BY FileID"))
                        {
                                // display records if there are records to display
                                if ($result->num_rows > 0)
                                {
                                
                                // display records in a table
                                        echo "<table border='1' cellpadding='10'>";
                                        
                                        // set table headers
                                                   
                                        echo "<tr><th>Date</th><th>File Name</th><th>Download Link</th><<th></th><th></th></tr>";
                                        
                                        while ($row = $result->fetch_object())
                                        {
                                        
                                                // set up a row for each record
                                                echo "<tr>";
                                                echo "<td>" . $row->filename . "</td>";
                                                echo "<td>" . $row->date . "</td>";
                                                echo "<td><a href=\". $row->downlink .\">Download Link</a></td>";
                                                echo "<td><a href='records.php?id=" . $row->id . "'>Edit</a></td>";
                                                echo "<td><a href='delete.php?id=" . $row->id . "'>Delete</a></td>";
                                                echo "</tr>";
                                        }
                                        
                                        echo "</table>";
                                }
                                // if there are no records in the database, display an alert message
                                else
                                {
                                        echo "No results to display!";
                                }
                        }
                        // show an error if there is an issue with the database query
                        else
                        {
                                echo "Error: " . $mysqli->error;
                        }
                        
                        // close database connection
                        $mysqli->close();
                
                ?>
 
1 comment
Status
Not open for further replies.
Back
Top