SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    variable that calls the values that is insert into a table

    Can anyone show me how to make a variable that calls the exact value inserted into a table? Because I only know to call from a textbox, like this:

    PHP Code:
    $name $_POST['txtname'];
    $gender $_POST['txtgender']; 
    but what would be the codes if I will call the exact inserted value from a table?

    $name = ?;
    $gender = ?;


    thanks in advance.

  2. #2
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't get value from a table. Tables are not "input" elements. However you can get a value from "textarea". See here: http://www.w3schools.com/tags/tag_textarea.asp

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Are you talking about values from a HTML table, as @petervasilev suspects, or are you by any chance talking about a database table?

  4. #4
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm talking about in the database sorry for not mentioning.
    By the way, this is my codes:

    for ($i=0; $i<sizeof($checkbox);$i++){
    $sql2="INSERT INTO tbltems SELECT NULL , '".$checkbox[$i]."' , id FROM tblName WHERE fname = '".$fname."' AND lname = '".$lname."'";
    $result2=mysql_query($sql2);
    }

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Is your question related to your other current post? http://www.sitepoint.com/forums/show...-on-2nd-insert

    If it is not, can you try and describe it a little better -- I will be honest, I cannot make sense of this question at all.

    Maybe someone else can help?

  6. #6
    SitePoint Member
    Join Date
    Dec 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes it is.


Bookmarks

Posting Permissions

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