Jump to content


Photo

Display All Records Using A Link Either Html Or Php


  • Please log in to reply
6 replies to this topic

#1 ianhaney

ianhaney

    Advanced Member

  • Members
  • PipPipPip
  • 81 posts

Posted 29 December 2012 - 06:49 AM

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

#2 trq

trq

    Advanced Member

  • Administrators
  • 30,733 posts
  • LocationSydney, Australia.

Posted 29 December 2012 - 06:54 AM

Your going to need to be more descriptive I'm afraid.

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#3 ianhaney

ianhaney

    Advanced Member

  • Members
  • PipPipPip
  • 81 posts

Posted 29 December 2012 - 06:57 AM

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

#4 scootstah

scootstah

    Advanced Member

  • Gurus
  • 2,889 posts
  • LocationUSA

Posted 29 December 2012 - 06:57 AM

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

while(!$succeed = try());

#5 ianhaney

ianhaney

    Advanced Member

  • Members
  • PipPipPip
  • 81 posts

Posted 29 December 2012 - 07:01 AM

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

#6 scootstah

scootstah

    Advanced Member

  • Gurus
  • 2,889 posts
  • LocationUSA

Posted 29 December 2012 - 07:10 AM

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, 29 December 2012 - 07:10 AM.

while(!$succeed = try());

#7 ianhaney

ianhaney

    Advanced Member

  • Members
  • PipPipPip
  • 81 posts

Posted 29 December 2012 - 07:29 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com