Jump to content

[SOLVED] Finding next index in table.


happs

Recommended Posts

Hey peeps :)

 

Hoping you can help..

 

function add_league () {
   $name = strtoupper(trim(addslashes($_POST['name'])));
   mysql_query("INSERT INTO leagues (name, format, division) VALUES ('{$name}', '{$_POST['format']}', 'A')");
   echo 'League Added: ' . $name . '(' . $_POST['format'] . ')';
   echo ' [ <a href="' . $_SERVER['PHP_SELF'] . '?action=edit&league_id=' . $row_leagues['id'] . '">EDIT THIS LEAGUE</a> ]';
}

 

As you can see, an entry has just been made into the database, but the following echo requires that entrie's ID. What is the best way of getting the LAST entry into the database ? Or even better, get THAT entrie's ID.

 

Thank you very much for your help in advance.

 

- Alex

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.