Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-27-2004, 01:06 AM   PM User | #1
Destroyallx
New to the CF scene

 
Join Date: Feb 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Destroyallx is an unknown quantity at this point
Linking to DB content?

ok, i have a problem. i have form that users can submit stuff into my database. i want only one row to of info submited to show up on a page..which ive done. now, id like to have that one row that shows up to be linkable to the rest of the rest of the content that was submited. in other words create an index/link page. how can i do this?
Destroyallx is offline   Reply With Quote
Old 02-27-2004, 10:13 AM   PM User | #2
piz
Regular Coder

 
Join Date: Jul 2002
Location: Barcelona
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
piz is an unknown quantity at this point
I didn't understand exactly what you want, I think...

You want something like this?

PHP Code:
$sql "SELECT * FROM table";

if(
is_numeric($_GET['row']))$sql.=" LIMIT ".$_GET['row'].",1";

$res mysql_query($sql);

switch(
mysql_num_rows($res))
{
   case 
0:
      
// no rows found
      
break;
   case 
1:
     
// display only one row
      
break;
   default:
     
// display whole table

Now you can select exactly one row by linkinf to the url yourscript.php?row=10 (to show the 10th row).

Something like this?
piz is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:07 PM.


Advertisement
Log in to turn off these ads.