Jump to content

Recommended Posts

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

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 />';
   }
}

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

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.

Edited by scootstah
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.