Results 1 to 5 of 5

Thread: Create an ID?

  1. #1
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default Create an ID?

    I have the following code, the only problem with it: I can't get the ID of the entry.

    PHP Code:
    <?php
    // The database connetcion
    include "config.php";

    //Variables for mySQL
    $comment = ($_POST[comment]);
    $name = ($_POST[name]);
    $grade = ($_POST[grade]);
    $id $get_id[id]; 
    $get_current mysql_fetch_array(mysql_query("select comment, grade, name, id from petition where id = '$id'"));

    // mySQL
    mysql_query("update petition set name = '$name' where id = '$id', update petition set grade = '$grade' where id = '$id', update petition set comment = '$comment' where id = '$id'");
    $get_id mysql_fetch_array(mysql_query("select id from petition"));
    $sql "SELECT * FROM petition";
    $check mysql_query("SELECT name, grade, comment FROM petition") or die("Sorry, the data couldn't be displayed. Please check back later.");

    //Other crap

    while ($display mysql_fetch_array($check)) {

        
    $name $display['name'];
        
    $grade $display['grade'];
        
    $comment $display['comment'];

        
    // Above are variables defined for our Name, Gradeand Comment.

        
    echo "
    <strong>Name:</strong> 
    $name 
    <br> 
        <strong>Edit:</strong> <a href=\"editcomment.php?id=
    {$get_current["id"]}\">edit this comment</a>
    <br>
    <strong>Grade / Other:</strong> 
    $grade
    <br>
    <strong>Comment:</strong><br>
    $comment
    <br>
    ____________________________________________________________<br /><br />
    "
    ;

    }
    ?>
    Could someone maybe make it so it gets the ID of the entry? As right now, it just links to: /comment.php?id=


    Selling DJ/Habbo layout, more info here.


  2. #2
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Why create a new thread for something that you already have a thread for?

  3. #3
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    The other thread is somehting differne,t I am asking for someone to edit the code for an ID.


    Selling DJ/Habbo layout, more info here.


  4. #4
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    You also asked in that thread about the ID thing.

  5. #5
    Join Date
    Apr 2007
    Location
    england
    Posts
    536
    Tokens
    0

    Default

    Ok, cool?

    Is there anybody who has a clue what i'm talking about, and if you do is it possible to add to that code?


    Selling DJ/Habbo layout, more info here.


Posting Permissions

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