ianhaney Posted December 29, 2012 Share Posted December 29, 2012 Hi I have manged to get the results displayed based on the users input but now I need a link to display all records using either a html or php link and am bit stuck on how to do it Can anyone point me in the right direction please Thank you Ian Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/ Share on other sites More sharing options...
trq Posted December 29, 2012 Share Posted December 29, 2012 Your going to need to be more descriptive I'm afraid. Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1401997 Share on other sites More sharing options...
ianhaney Posted December 29, 2012 Author Share Posted December 29, 2012 Hi trq Thank you for the reply I need something like the following they click on a link and that link then displays all the records in the database table that I have in mysql database Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1401998 Share on other sites More sharing options...
scootstah Posted December 29, 2012 Share Posted December 29, 2012 Your post is a bit vague. You can iterate through multiple database results with a while loop. $mysqli = new mysqli('localhost', 'root', 'root', 'dbname'); $query = "SELECT * FROM table"; // execute query if ($result = $mysqli->query($query)) { // iterate through results while($row = $result->fetch_assoc()) { echo $row['column'] . '<br />'; } } Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1401999 Share on other sites More sharing options...
ianhaney Posted December 29, 2012 Author Share Posted December 29, 2012 Sorry am not very good at explaining things I need a HTML link that when a user clicks on the link it will show all the records that are in my database table that is called managers see below <a href="linkname">Show all records</a> I know it won't look like that as will prob be different in PHP but using a HTML link would be better Sorry not sure how else to explain it Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1402000 Share on other sites More sharing options...
scootstah Posted December 29, 2012 Share Posted December 29, 2012 There is no such thing as a "PHP link". You can link to a PHP page, but you would still be using HTML markup. It sounds like all you need to do is make another .php file and then link to it with an anchor tag. So, for example, create "all_results.php", and then create a link with <a href="all_results.php">View All Results</a> But I can't be more specific without knowing more about your environment. Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1402001 Share on other sites More sharing options...
ianhaney Posted December 29, 2012 Author Share Posted December 29, 2012 Hi Scootstah That's works perfect, it will do as does what I need it to do Thank you so much and thank you everyone for helping out Link to comment https://forums.phpfreaks.com/topic/272481-display-all-records-using-a-link-either-html-or-php/#findComment-1402004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.