Announcement

Collapse
No announcement yet.

Pull out info by id #

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pull out info by id #

    i have a table called articles with 2 columns, id (which is an auto increased number) and a column called description

    now lets say I want to 'print' the description for the row with id 12 how can i do this?

    thanks

    -Dimava
    NXSupport Admin

  • #2
    PHP Code:

    $result 
    mysql_query("SELECT description FROM articles WHERE id=12");

    $description mysql_result($result0);

    echo 
    $description

    Comment


    • #3
      PHP Code:
      $result=mysql_fetch_array(mysql_query("SELECT * FROM articles WHERE id=12"));
      echo 
      "ID number: $result[id] produces $result[description]"

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X