473,703 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting ID from a presented table

I'm having a MySQl table wih a lot of information. I want to present some
main fields in a table on one page. Each record do, of course, have a unique
ID. The presnted table will have one field as a linked field. I want to be
able to click this link, retreive the ID information for that record and
then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks
Mar 18 '07 #1
12 1759
Lennart Anderson wrote:
I'm having a MySQl table wih a lot of information. I want to present some
main fields in a table on one page. Each record do, of course, have a unique
ID. The presnted table will have one field as a linked field. I want to be
able to click this link, retreive the ID information for that record and
then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks

Put the id in the link itself.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 18 '07 #2

"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt******** *************** *******@comcast .com...
Lennart Anderson wrote:
>I'm having a MySQl table wih a lot of information. I want to present some
main fields in a table on one page. Each record do, of course, have a
unique ID. The presnted table will have one field as a linked field. I
want to be able to click this link, retreive the ID information for that
record and then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks

Put the id in the link itself.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
I think I get the idea but I don't know how to doo that. Can you give me an
aidea of how such a link with, I guess, embedded ID would look like?
Mar 18 '07 #3

"Lennart Anderson" <le************ **@tele2.seskre v i meddelandet
news:n%******** *******@nntpser ver.swip.net...
>
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt******** *************** *******@comcast .com...
>Lennart Anderson wrote:
>>I'm having a MySQl table wih a lot of information. I want to present
some main fields in a table on one page. Each record do, of course, have
a unique ID. The presnted table will have one field as a linked field. I
want to be able to click this link, retreive the ID information for that
record and then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks

Put the id in the link itself.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============== ====

I think I get the idea but I don't know how to doo that. Can you give me
an aidea of how such a link with, I guess, embedded ID would look like?
Furthermore, if I click a link on a displayed record I can only get
information from the link of the last displayed record. How to get
information of the ID from any of the earlier displayed records?
Mar 18 '07 #4
Lennart Anderson wrote:
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt******** *************** *******@comcast .com...
>Lennart Anderson wrote:
>>I'm having a MySQl table wih a lot of information. I want to present some
main fields in a table on one page. Each record do, of course, have a
unique ID. The presnted table will have one field as a linked field. I
want to be able to click this link, retreive the ID information for that
record and then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks
Put the id in the link itself.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============== ====

I think I get the idea but I don't know how to doo that. Can you give me an
aidea of how such a link with, I guess, embedded ID would look like?

Do you know how to do it in html? Same idea - just generated with a PHP
echo statement instead.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 18 '07 #5
Lennart Anderson wrote:
"Lennart Anderson" <le************ **@tele2.seskre v i meddelandet
news:n%******** *******@nntpser ver.swip.net...
>"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt******* *************** ********@comcas t.com...
>>Lennart Anderson wrote:
I'm having a MySQl table wih a lot of information. I want to present
some main fields in a table on one page. Each record do, of course, have
a unique ID. The presnted table will have one field as a linked field. I
want to be able to click this link, retreive the ID information for that
record and then present detailed data for that record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks
Put the id in the link itself.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============= =====
I think I get the idea but I don't know how to doo that. Can you give me
an aidea of how such a link with, I guess, embedded ID would look like?
Furthermore, if I click a link on a displayed record I can only get
information from the link of the last displayed record. How to get
information of the ID from any of the earlier displayed records?

If you want to get information from previously displayed records you're
going to have to save them and pass them along somehow - i.e in a
session or hidden fields in your form.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 18 '07 #6

"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:yb******** *************** *******@comcast .com...
Lennart Anderson wrote:
>"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt******* *************** ********@comcas t.com...
>>Lennart Anderson wrote:
I'm having a MySQl table wih a lot of information. I want to present
some main fields in a table on one page. Each record do, of course,
have a unique ID. The presnted table will have one field as a linked
field. I want to be able to click this link, retreive the ID
informatio n for that record and then present detailed data for that
record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks
Put the id in the link itself.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============= =====

I think I get the idea but I don't know how to doo that. Can you give me
an aidea of how such a link with, I guess, embedded ID would look like?

Do you know how to do it in html? Same idea - just generated with a PHP
echo statement instead.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
No, I do not know how to do that in HTML.
But, once again, the problem is that I have a number of records presented in
a table. All records do have unique ID. When preseneted by the hTML page
they are parsed into "hard-coded" HTML and although I can have a field to
act as a link I can't get the ID for the special record I am selecting. Only
the ID for the last presented record will come through since that ID is
still present in the array. Any hint of how to get the ID from any selected
record?
Mar 19 '07 #7
Lennart Anderson wrote:
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:yb******** *************** *******@comcast .com...
>Lennart Anderson wrote:
>>"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt****** *************** *********@comca st.com...
Lennart Anderson wrote:
I'm having a MySQl table wih a lot of information. I want to present
some main fields in a table on one page. Each record do, of course,
have a unique ID. The presnted table will have one field as a linked
field. I want to be able to click this link, retreive the ID
informati on for that record and then present detailed data for that
record on the next page.
How do I retreive the ID?
Any hints are very much appreciated.
Thanks
Put the id in the link itself.

--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============ ======
I think I get the idea but I don't know how to doo that. Can you give me
an aidea of how such a link with, I guess, embedded ID would look like?
Do you know how to do it in html? Same idea - just generated with a PHP
echo statement instead.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============== ====

No, I do not know how to do that in HTML.
But, once again, the problem is that I have a number of records presented in
a table. All records do have unique ID. When preseneted by the hTML page
they are parsed into "hard-coded" HTML and although I can have a field to
act as a link I can't get the ID for the special record I am selecting. Only
the ID for the last presented record will come through since that ID is
still present in the array. Any hint of how to get the ID from any selected
record?

OK, posting the code you're using would help a lot.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 19 '07 #8

"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:0o******** *************** *******@comcast .com...
Lennart Anderson wrote:
>"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:yb******* *************** ********@comcas t.com...
>>Lennart Anderson wrote:
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt***** *************** **********@comc ast.com...
Lennart Anderson wrote:
>I'm having a MySQl table wih a lot of information. I want to present
>some main fields in a table on one page. Each record do, of course,
>have a unique ID. The presnted table will have one field as a linked
>field. I want to be able to click this link, retreive the ID
>informatio n for that record and then present detailed data for that
>record on the next page.
>How do I retreive the ID?
>Any hints are very much appreciated.
>Thanks
Put the id in the link itself.
>
--
=========== =======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=========== =======
I think I get the idea but I don't know how to doo that. Can you give
me an aidea of how such a link with, I guess, embedded ID would look
like?
Do you know how to do it in html? Same idea - just generated with a PHP
echo statement instead.

--
============= =====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============= =====

No, I do not know how to do that in HTML.
But, once again, the problem is that I have a number of records presented
in a table. All records do have unique ID. When preseneted by the hTML
page they are parsed into "hard-coded" HTML and although I can have a
field to act as a link I can't get the ID for the special record I am
selecting. Only the ID for the last presented record will come through
since that ID is still present in the array. Any hint of how to get the
ID from any selected record?

OK, posting the code you're using would help a lot.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Here is the essential part of the code with the presneted table where one of
the records field will be a link. I want to retreive the ID for any selefted
record from, say, 25 presented.

mysql_select_db ('db2') or die ('Unable to select database!');
// create and execute query
$query = "SELECT ID, DATE_FORMAT(add ate, '%m-%d') AS adday,
DATE_FORMAT(add ate, '%H:%i')as adtime, addate, adnamn, adcat,
adheader,adtext ,adprice,adcats .catname FROM ads, adcats where ads.adcat =
adcats.catid order by ID DESC";
$result = mysql_query($qu ery)
or die ('Error in query: $query. ' . mysql_error());
// check if records were returned
if (mysql_num_rows ($result) 0)
{
// iterate over record set
// print each field

echo '<h2>Test on data retrieval from the data base</h2></br>';
echo '<table border=0 cellpadding=2 width = 100% bgcolor="#FFFF9 9"
bordercolor="#F FFFFF">';
echo '<tr>
<td>Ad-No.</td>
<td>Day</td>
<td>Time</td>
<td>Ad-header</td>
<td>Price CI$</td>
<td>Category</td>

</tr>';

while($row = mysql_fetch_obj ect($result))

{
echo '<tr>';
echo '<td width=5% bgcolor="#FFFFF F" align = "right">' . ($row->ID) .
'</td>';
echo '<td width=4% bgcolor="#FFFFF F">' . ($row->adday) . '</td>';
echo '<td width=5% bgcolor="#FFFFF F">' . ($row->adtime) . '</td>';
echo '<td width=40% bgcolor="#FFFFF F">' . '<a href= "advertinfo.php " >' .
($row->adheader) . '</td>';
echo '<td width = 6% bgcolor="#FFFFF F" align = "right">' . ($row->adprice) .
'</td>';
echo '<td width = 18% bgcolor="#FFFFF F">' . ($row->catname) . '</td>';
echo '</tr>';
}

echo '</table>';

}
else
{
// print error message
echo 'No rows found!';
}
Mar 19 '07 #9
Lennart Anderson wrote:
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:0o******** *************** *******@comcast .com...
>Lennart Anderson wrote:
>>"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:yb****** *************** *********@comca st.com...
Lennart Anderson wrote:
"Jerry Stuckle" <js*******@attg lobal.netskrev i meddelandet
news:xt**** *************** ***********@com cast.com...
>Lennart Anderson wrote:
>>I'm having a MySQl table wih a lot of information. I want to present
>>some main fields in a table on one page. Each record do, of course,
>>have a unique ID. The presnted table will have one field as a linked
>>field. I want to be able to click this link, retreive the ID
>>informati on for that record and then present detailed data for that
>>record on the next page.
>>How do I retreive the ID?
>>Any hints are very much appreciated.
>>Thanks
>Put the id in the link itself.
>>
>--
>========== ========
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attgl obal.net
>========== ========
I think I get the idea but I don't know how to doo that. Can you give
me an aidea of how such a link with, I guess, embedded ID would look
like?
Do you know how to do it in html? Same idea - just generated with a PHP
echo statement instead.

--
============ ======
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============ ======
No, I do not know how to do that in HTML.
But, once again, the problem is that I have a number of records presented
in a table. All records do have unique ID. When preseneted by the hTML
page they are parsed into "hard-coded" HTML and although I can have a
field to act as a link I can't get the ID for the special record I am
selecting. Only the ID for the last presented record will come through
since that ID is still present in the array. Any hint of how to get the
ID from any selected record?
OK, posting the code you're using would help a lot.

--
============== ====
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
============== ====

Here is the essential part of the code with the presneted table where one of
the records field will be a link. I want to retreive the ID for any selefted
record from, say, 25 presented.

mysql_select_db ('db2') or die ('Unable to select database!');
// create and execute query
$query = "SELECT ID, DATE_FORMAT(add ate, '%m-%d') AS adday,
DATE_FORMAT(add ate, '%H:%i')as adtime, addate, adnamn, adcat,
adheader,adtext ,adprice,adcats .catname FROM ads, adcats where ads.adcat =
adcats.catid order by ID DESC";
$result = mysql_query($qu ery)
or die ('Error in query: $query. ' . mysql_error());
// check if records were returned
if (mysql_num_rows ($result) 0)
{
// iterate over record set
// print each field

echo '<h2>Test on data retrieval from the data base</h2></br>';
echo '<table border=0 cellpadding=2 width = 100% bgcolor="#FFFF9 9"
bordercolor="#F FFFFF">';
echo '<tr>
<td>Ad-No.</td>
<td>Day</td>
<td>Time</td>
<td>Ad-header</td>
<td>Price CI$</td>
<td>Category</td>

</tr>';

while($row = mysql_fetch_obj ect($result))

{
echo '<tr>';
echo '<td width=5% bgcolor="#FFFFF F" align = "right">' . ($row->ID) .
'</td>';
echo '<td width=4% bgcolor="#FFFFF F">' . ($row->adday) . '</td>';
echo '<td width=5% bgcolor="#FFFFF F">' . ($row->adtime) . '</td>';
echo '<td width=40% bgcolor="#FFFFF F">' . '<a href= "advertinfo.php " >' .
($row->adheader) . '</td>';
echo '<td width = 6% bgcolor="#FFFFF F" align = "right">' . ($row->adprice) .
'</td>';
echo '<td width = 18% bgcolor="#FFFFF F">' . ($row->catname) . '</td>';
echo '</tr>';
}

echo '</table>';

}
else
{
// print error message
echo 'No rows found!';
}

OK, if you're going to make it a link, you have to pass the id as a
parameter in the link, i.e.

echo '<td width=40% bgcolor="#FFFFF F">' . '<a href= "advertinfo.php ?id='
.. $row['id'] . " >' . ($row->adheader) . '</td>';

This will pass the link as "advertinfo.php ?id=3", for example.

Then in advertinfo.php you use access it with $_GET['id'].

Be sure to use isset($_GET['id']) in case someone comes to this page
without an id being passed.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 19 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

303
17657
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b. Yahoo store was originally written in Lisp. c. Emacs The issues with these will probably come up, so I might as well mention them myself (which will also make this a more balanced
12
1664
by: Mary Catherine | last post by:
I have 2 scipts that I am trying to get to run on the same page. One is a time/date script, the other is a countdown script (i.e. countdown days, hours, mins until a given date). They both work independent of each other, however, when both are on the page, the "active clock" does not work. I am assuming it is because some of the variables are the same??? Can anyone help please?!?! Here are the 2 scripts: **Active Clock that displays...
84
3912
by: Bibby | last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: Hireability Portability Flexibility The likely candidates seem to be Java, VB.Net, C, C++, C#.
4
3135
by: ano | last post by:
I have a console application and a lot of Console.WriteLine(). Now I want to convert it to Windows Form Application. Is it possible to getting all of the console messages to Form.Textbox without changing every Console.WriteLine()? Thank you in advance. ano
6
2723
by: sgottenyc | last post by:
Hello, If you could assist me with the following situation, I would be very grateful. I have a table of data retrieved from database displayed on screen. To each row of data, I have added action buttons, such as "Edit", "Add", and "Comment". Since I do not know how many rows of data will be retrieved - and therefore how many buttons I need - I am using button arrays for each button, like so: echo "<input type=\"submit\"...
1
2680
by: ced69 | last post by:
having trouble getting marquee to work get object required errors tring t <title>This Month at the Chamberlain Civic Center</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="Dunbarlab9.js" type="text/javascript"></script> <script type="text/javascript">
4
2262
by: Bernie | last post by:
Hello all, I am new to the group and new to javascripting, so I am hoping to find some good help here. Here is a snippet of my code: HTML: Name: <input type="text" name="ageName0" id="ageName0" /> <input type="radio" value="0" name="age0" onclick="getPrice();" /6
18
1867
by: Quizzed | last post by:
Hi, New user here and using a ms access 97 database. I have a form containing a list box which presents the contents of a table. On double clicking a record, i need the record to be presented in a new form where further data can be added. I set the event procedure against the list box on Double Click, i can then use the DoCmd.OpenForm "frmDataEntry" but how do i pass the value that ive selected (double clicked), to then populate the...
8
2520
by: Innocent2104 | last post by:
Hi there, The script below displays the attached output but as shown, it skips certain days and i need to include these to calculate my avg balance for a certain month, i.e.Nov. How do i update the script to include for example between 01 Nov and 05 Nov, there was no entries, therefore my balance should remain the same & display my missing dates 02,03,04 Nov?? DECLARE @STARTDATE DATETIME, @ENDDATE DATETIME SET @STARTDATE = '2009-11-01' ...
0
9121
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6588
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5922
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4432
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3123
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2450
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2069
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.