Jump to content

Unique URL Displayed by Submission id


leblanc

Recommended Posts

Hello everyone,

 

I am in need of some help  :(

I have been trying to figure out how to display a page with a unique url by the submission_id of a table.

Example: www.mysite.com/display.php?id=4

 

I figured out how to display the tables information stored in the database through the submission_id with:

WHERE submission_id='4'

 

But I need figure out how to create a unqiue url by using the submission_id=4....

Here is what I started with to display the table with the submission_id=4 on display.php

Thanks in advance for any help.

 

<?php
$username = "s52_tools";
$password = "gss";
$hostname = "localhost";	
$dbh = mysql_connect($hostname, $username, $password) 
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
$selected = mysql_select_db("s52_form",$dbh) 
or die("Could not select s52_form");

$data = mysql_query("SELECT * FROM ft_form_1" WHERE submission_id='4'") 
or die(mysql_error()); 


Print "<div id=\"container\">"; 
while($info = mysql_fetch_array( $data )) 
{ 
Print "<br />"; 
Print "<b>Name:</b>" .$info['col_2'] . "<br />"; 
Print "<b>Email:</b>" .$info['col_3'] . "<br />"; 
Print "<b>Phone:</b>" .$info['col_4'] . "<br />";
Print "<b>Phone2:</b>" .$info['col_5'] . "<br />";
Print "<b>Subject:</b>" .$info['col_6'] . "<br />"; 
Print "<b>Blob:</b>" .$info['col_7'] . "<br />"; 
Print "<b>Date:</b>" .$info['submission_date'] . "<br />";   
} 
Print "</div>"; 

?>

Link to comment
Share on other sites

So ideally, I have gotten my self to add this:

 

 

$submission_id = $_GET['id'];

 

and this:

 

 

$data = mysql_query("SELECT * FROM ft_form_1" WHERE id='$submission_id'")
or die(mysql_error());

 

But I still cannot get it work. I think I am on the right path, but am lost.

Link to comment
Share on other sites

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.