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
https://forums.phpfreaks.com/topic/73108-solved-finding-next-index-in-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.