Web Analytics Made Easy -
StatCounter Linking to DB content? - CodingForum

Announcement

Collapse
No announcement yet.

Linking to DB content?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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?
    www.united-scripts.com
    www.codebattles.org

    Comment

    Working...
    X