Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:04:22+00:00 2026-06-04T19:04:22+00:00

Below is my Php code. Would anyone be able to tell me how to

  • 0

Below is my Php code. Would anyone be able to tell me how to remove the hyperlinking of every single SQL entry in this code?

As I don’t want my users to click into any of the entries and then directed to another web page. I just want a static table with entries from my sql database.

Thanks very much!

<?
 #Get the event id from $_GET
    $int_event_id = $_GET["EventID"];
    if((int)$int_event_id)
    {
        $pdo = new PDO('mysql:host=localhost;dbname=clubresults', 'root', '12345678');
    #Set Error Mode to ERRMODE_EXCEPTION.
    $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);  
$query = $pdo->query("SELECT EventName, Score, Place from results WHERE EventID ='$int_event_id' ORDER By EventID ASC");
$rowset = array();

if ($query) {
  while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
    // Build array of rows
    $rowset[] = $row;
  }    

  // Output header first
  $headrow = $rowset[0];
  print("<table border=\"1\">\n<tr>\n");
  // Use $rowset[0] to write the table heading
  foreach ($headrow as $col => $val) {
    printf("<th>%s</th>\n", $col);
  }
  print("</tr>");

  // Then output table rows.
  // Outer loop iterates over row
  foreach ($rowset as $row) {
     print("<tr>");
     // Inner loop iterates over columns using $col => $val
     foreach ($row as $col => $val) {
        // We don't know your column names, but substitute the first column (the ID) for FIRSTCOL here
        printf("<td><a href=\"index.php?ID=%s\">%s</a></td>\n", $row['EventID'],$val);
     }
     print("</tr>");
  }
}}
print("</table>");
?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:04:24+00:00Added an answer on June 4, 2026 at 7:04 pm

    If you change this line:

    printf("<td><a href=\"index.php?ID=%s\">%s</a></td>\n", $row['EventID'],$val);
    

    To this you should be fine:

    printf("<td>%s</td>\n", $val);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the PHP code below, I would expect to get '2' as my output.
How do I convert the below PHP code to VB.NET? <?php $X_HOST =foo.com; $X_URL
When I use a conditional statement targeting IE6 and below with some PHP code
Below is my code for a simple form in the create_session.php page. I am
The code below gets the username/password and runs it thru the backend.php script. <?php
For the below code, there ia a form in the location /home/form.php .How can
I have a real basic form (code below) with a bunch of back-panel PhP.
Possible Duplicate: php/Mysql query with inserting date fails I have a datepicker code below:
I want to know if the below code: <?php printf (%s, $some_variable); ?> is
I have a basic PHP question, take the code below for example, let's say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.