Jump to content

[SOLVED] recognize pass


Lambneck

Recommended Posts

Hello,

I have a php code that displays a list of links.

when a link is chosen it is to display data from

mysql database based on the "submission_id"

specified by the link chosen. This data would

then be displayed on a new "display.php" page.

 

My question is how do i code the display.php

page in order for it to recognize the submission_id

being specified by the link chosen.

 

the code of the initial page:

 

    $result = mysql_query("SELECT submission_id, col_4 FROM $table ORDER BY submission_date DESC");
    if (!$result) {
        die("Query to show fields from table failed:".mysql_error());
    }

    while($row = mysql_fetch_array($result))
    {
      echo '<a href="Display.php?id='.$row['submission_id'].'">'.$row['col_4'].'</a>';
      echo "<br />";
    }
    mysql_free_result($result);

Link to comment
https://forums.phpfreaks.com/topic/102172-solved-recognize-pass/
Share on other sites

    $result = mysql_query("SELECT submission_id, col_4 FROM $table ORDER BY submission_date DESC");
    if (!$result) {
        die("Query to show fields from table failed:".mysql_error());
    }

    while($row = mysql_fetch_array($result))
    {
      echo "<a href="Display.php?id=\".$row['submission_id'].'\">'.$row['col_4'].'</a>";
      echo "<br />";
    }
    mysql_free_result($result);

 

I didn't read what you wrote, but i found a mistake. `,=,

thanks,

I'm working with the following code as of now,

but something isn't right cause it doesn't display.

 

$id = (int) $_GET['id']; // since the submission ID is named "id" in the query string!

$sql = "SELECT * FROM $table WHERE submission_id=$id";
$result = mysql_query($sql) or die("Error ". mysql_error(). " with query ". $sql);
if(mysql_num_rows($result) == 1){
$row = mysql_fetch_assoc($sql);
//print out information
}else{
echo 'That record ID does not exist!';
}
?>

ok it recognizes the pass; the submission id number is in the url

but on the page none of the data is displayed.  ???

anyone see anything wrong?

 

$id = (int) $_GET['id']; // since the submission ID is named "id" in the query string!

$sql = "SELECT * FROM $table WHERE submission_id=$id";
$result = mysql_query($sql) or die("Error ". mysql_error(). " with query ". $sql);
if(mysql_num_rows($result) == 1){
$row = mysql_fetch_assoc($sql);
//print out information
}else{
echo 'That record ID does not exist!';
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.