I have a MySQL table on my web server (external web host) that has an
auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the table,
that is, the ID that belongs to the last record added.
Note, I need it to work across and between connection session, not from
within the same connection session.
thx
--
Robert Oschler
"Let the web hear you, add your voice to your web site in minutes!"
-- http://audiodirect.spiderchase.com/
(For a limited time, free voiceover with every sign-up, use this link
instead)
-- http://audio.spiderchase.com/
(A song - are you blue?)
-- http://bluedreams.spiderchase.com/ 4 10451
~Select uniqueid from table order by uniqueid DESC~
Just run the query once and it'll give you the highest record if you
substitute `uniqueid` and `table` with the correct values. Afaik,
there's no function for php that maintains state variables of database
fields, (unless you write one).
Robert Oschler wrote: I have a MySQL table on my web server (external web host) that has an auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the table, that is, the ID that belongs to the last record added.
Note, I need it to work across and between connection session, not from within the same connection session.
~Select uniqueid from table order by uniqueid DESC~
Just run the query once and it'll give you the highest record if you
substitute `uniqueid` and `table` with the correct values. Afaik,
there's no function for php that maintains state variables of database
fields, (unless you write one).
Robert Oschler wrote: I have a MySQL table on my web server (external web host) that has an auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the table, that is, the ID that belongs to the last record added.
Note, I need it to work across and between connection session, not from within the same connection session.
Do a search for "Select Last_Insert_ID()" in the manuals.
That will retrieve the last ID in an auto_increment field.
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:wJ******************@news2.news.adelphia.net. .. I have a MySQL table on my web server (external web host) that has an auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the
table, that is, the ID that belongs to the last record added.
Note, I need it to work across and between connection session, not from within the same connection session.
thx
--
Robert Oschler "Let the web hear you, add your voice to your web site in minutes!" -- http://audiodirect.spiderchase.com/ (For a limited time, free voiceover with every sign-up, use this link instead) -- http://audio.spiderchase.com/ (A song - are you blue?) -- http://bluedreams.spiderchase.com/
Do a search for "Select Last_Insert_ID()" in the manuals.
That will retrieve the last ID in an auto_increment field.
"Robert Oschler" <no_replies@fake_email_address.invalid> wrote in message
news:wJ******************@news2.news.adelphia.net. .. I have a MySQL table on my web server (external web host) that has an auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the
table, that is, the ID that belongs to the last record added.
Note, I need it to work across and between connection session, not from within the same connection session.
thx
--
Robert Oschler "Let the web hear you, add your voice to your web site in minutes!" -- http://audiodirect.spiderchase.com/ (For a limited time, free voiceover with every sign-up, use this link instead) -- http://audio.spiderchase.com/ (A song - are you blue?) -- http://bluedreams.spiderchase.com/
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Seth |
last post by:
I want to create a simple hash function that can hash strings. Currently I'm
storing passwords as strings in a DB but want to store them as a hash. I
don't need any proper standardised hashing e.g....
|
by: Tim Fountain |
last post by:
We've recently enabled slow query logging on a server and it's proving
interesting seeing which queries are bogging things down. This one is
puzzling me a little:
SELECT articleid, type,...
|
by: Vinod Bhaskar |
last post by:
Hi Friends,
In my linux server (LOCAL), accessing data through the PHP scripts from
MySQL (3.23.41)tables, it is taking more time. Earlier it was very fast.
Now a days
some reports it is...
|
by: Jesse Sheidlower |
last post by:
I'm struggling with speed issues on some queries that
I would have expected to be relatively fast. Perhaps
even more frustratingly, when I've tried to break
these down into their components, they...
|
by: Robert Oschler |
last post by:
I have a MySQL table on my web server (external web host) that has an
auto-increment integer as it's primary key field.
Is there a quick PHP function that will get me the highest ID in the table,...
|
by: 42 |
last post by:
Hi,
I've run into a block, that I'm almost sure is really simple...but I
can't seem to clue in right now.
I'd like to create a user control that takes input like this:
<mycontrol:panel...
|
by: www.web20developers.com |
last post by:
http://www.web20developers.com
http://www.web20developers.com/index.php?option=com_content&task=view...
Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
AJAX -...
|
by: eselk |
last post by:
I'm doing some speed tests. I created a brand-new table, with just
one "Long Integer" field. I'm testing adding 1000 records. If I use
the "Export" feature in Access, it takes only a few seconds...
|
by: aadsaca |
last post by:
i have a table w/ ff fieldname
table name:elections
here's the example contents of my table:
Candidate_name
Arjel
Joseph
Gloria
Arjel
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |