adding to form?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christo

    adding to form?

    novice with mysql so be slow.

    Want to be able to update the contents of a database row through a
    form, i want to be able to load the contents of a specific row

    my database table is as follows

    id(pk) | title | body | date(text field)
    ---------------------------------------------------------------------------
    1 | hello | test | 15-11-2006 13:44
    2 | again | test2 | 15-11-2006 13:45


    basically i want to be able to add the contents of one of thw rows into
    various forms, for instance lets say i want to edit all of the stuff in
    the table which i do, and i want to add the title and the body into
    forms respectively named title and body how would i do this?

    I tried using a select statement to select all of the items from the
    table in the database and put where id='".$id."'
    Basically i dont have a clue wehre to start here so can someone please
    help me

  • Marcin Dobrucki

    #2
    Re: adding to form?

    Christo wrote:
    novice with mysql so be slow.
    ....
    I tried using a select statement to select all of the items from the
    table in the database and put where id='".$id."'
    Basically i dont have a clue wehre to start here so can someone please
    help me
    Okay, at this point you need to start with:


    /m

    Comment

    • Pedro Graca

      #3
      Re: adding to form?

      Marcin Dobrucki wrote:
      Okay, at this point you need to start with:
      http://www.google.com/search?hl=en&q...=Google+Search
      ............... ............... ..^^^^^^

      Do you think searching in French (or Portuguese, or Chinese, ...) will
      not return adequate results? :)

      --
      I (almost) never check the dodgeit address.
      If you *really* need to mail me, use the address in the Reply-To
      header with a message in *plain* *text* *without* *attachments*.

      Comment

      • Shelly

        #4
        Re: adding to form?


        "Christo" <cmw1985@google mail.comwrote in message
        news:1163598413 .488377.287410@ e3g2000cwe.goog legroups.com...
        novice with mysql so be slow.
        >
        Want to be able to update the contents of a database row through a
        form, i want to be able to load the contents of a specific row
        >
        my database table is as follows
        >
        id(pk) | title | body | date(text field)
        ---------------------------------------------------------------------------
        1 | hello | test | 15-11-2006 13:44
        2 | again | test2 | 15-11-2006 13:45
        >
        >
        basically i want to be able to add the contents of one of thw rows into
        various forms, for instance lets say i want to edit all of the stuff in
        the table which i do, and i want to add the title and the body into
        forms respectively named title and body how would i do this?
        >
        I tried using a select statement to select all of the items from the
        table in the database and put where id='".$id."'
        Basically i dont have a clue wehre to start here so can someone please
        help me
        >
        $query = "SELECT * FROM theTableName WHERE id='" . $idChosenForSea rch . "'";
        (That is a ' folled by a "; then
        later a " followed by a ' followed by a ")

        you have:

        mysql_select_db ($database, $dbLogin);
        $result = mysql_query($qu ery, $dbLogin) or die(mysql_error ());

        Where $dbLogin is the result of connecting to the database.

        You extract the information as:

        $row = mysql_fetch_ass oc($result);
        $title = $row['title'];
        $body = $row['body'];
        $date = $row['date'];

        Hope that helps to get you started.

        Shelly


        Comment

        • Christo

          #5
          Re: adding to form?

          Thanks i got it all sorted now, was kind of a botch of everything that
          i have read and it works so im smiling thanks everyone.

          Chris


          Shelly wrote:
          "Christo" <cmw1985@google mail.comwrote in message
          news:1163598413 .488377.287410@ e3g2000cwe.goog legroups.com...
          novice with mysql so be slow.

          Want to be able to update the contents of a database row through a
          form, i want to be able to load the contents of a specific row

          my database table is as follows

          id(pk) | title | body | date(text field)
          ---------------------------------------------------------------------------
          1 | hello | test | 15-11-2006 13:44
          2 | again | test2 | 15-11-2006 13:45


          basically i want to be able to add the contents of one of thw rows into
          various forms, for instance lets say i want to edit all of the stuff in
          the table which i do, and i want to add the title and the body into
          forms respectively named title and body how would i do this?

          I tried using a select statement to select all of the items from the
          table in the database and put where id='".$id."'
          Basically i dont have a clue wehre to start here so can someone please
          help me
          >
          $query = "SELECT * FROM theTableName WHERE id='" . $idChosenForSea rch . "'";
          (That is a ' folled by a "; then
          later a " followed by a ' followed by a ")
          >
          you have:
          >
          mysql_select_db ($database, $dbLogin);
          $result = mysql_query($qu ery, $dbLogin) or die(mysql_error ());
          >
          Where $dbLogin is the result of connecting to the database.
          >
          You extract the information as:
          >
          $row = mysql_fetch_ass oc($result);
          $title = $row['title'];
          $body = $row['body'];
          $date = $row['date'];
          >
          Hope that helps to get you started.
          >
          Shelly

          Comment

          Working...