[thelist] Sessions in PHP4

rudy limeback r937 at interlog.com
Tue Jul 25 18:30:42 CDT 2000


> ... mysql offers a LAST_INSERT_ID function (as in SELECT
> LAST_INSERT_ID FROM table_whatever), which returns the
> last value automatically generated for an AUTO_INCREMENT
> field, so you could retrieve the primary key for the first insert that
way.

thank you katherine, what a lovely tip

this is the kind of thing that is really starting to attract me to mysql

on the other hand, i wonder if it's all that efficient, i mean, it's
[almost] the same as select max(id)

although i daresay there's no comparable way to get the last *random*
autonumber generated

does mysql support random autonumbers?

and anthony (i think it was you, anyway), what was the comparable technique
in sql/server -- @@identity or something? could you please refresh my
memory and summarize how this works?  is it an asp only thing, or do i need
a stored procedure?


<tip>
make sure there's a default mechanism in every directory to serve up a page
if the url being requested is at the directory level -- the default can
vary from server to server and even directory to directory, usually it's
index.html or home.htm or something similar... the reason you want to do
this is so that you can place test or comp pages into those directories on
your live server and not have anybody inadvertently find them... meanwhile
you can email people the url of the test or comp pages, and when the pages
have been approved, it's a simple two-step rename to make them live, rename
foo.html to foo(old).html and then rename footest.html to foo.html
</tip>


rudy.limeback
r937.com
evolt.org





More information about the thelist mailing list