Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    piz
    piz is offline
    Regular Coder
    Join Date
    Jul 2002
    Location
    Barcelona
    Posts
    246
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •