hi
you can use the mysql function LAST_INSERT_ID()
heres the info from the manual:
http://dev.mysql.com/doc/mysql/en/ODBC_and_last_insert_id.html
hope that helps
eoghan
Nathan Mealey wrote:
Is there a PEAR::DB equivalent to the mysql_insert_id()? I can't figure
out how to get the primary key ID
My status column in my Employee table should have two values Active and
Inactive. Right now all the active employees have the value Active and
the rest have a NULL value.
Why is it that the following commands do nothing?
UPDATE EMPLOYEE SET STATUS='Inactive' where STATUS != 'Active';
UPDATE
first off it would help if you specified what DB you are using and if
you are using a DB abstraction lib like PEAR::DB or something similar.
also have you tried running these lines directly in a cmdline sql client?
is the status column variable width? if not then the value may be
'Active '
I have a feeling that 'Status' field may be the problem. The word Status is
used by MySQL for other sql commands. Either place the fieldname in
backticks (the key under the ESC key) like so:
UPDATE `EMPLOYEE` SET `STATUS`='Inactive' where `STATUS` != 'Active';
or change the fieldname to
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:16 PM
Subject: Re: [PHP-DB] NULL VALUE
LightBulbMoment (tm): 5 seconds of searching on the MYSQL site tells
me
STATUS is a keyword. try either renaming your field or using backticks
Norland, Martin wrote:
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: Monday, January 03, 2005 12:16 PM
Subject: Re: [PHP-DB] NULL VALUE
LightBulbMoment (tm): 5 seconds of searching on the MYSQL site tells
me
STATUS is a keyword. try either renaming your field or
I apologize for my lack of information concerning this problem and I
appreciate the advice for beginners.
I also did not mean to post it on this list (If you notice my original
message also contained a thank you for a question never asked in this list).
I am terribly sorry about this error.
Hi Matthew,
there are some more comments below but just for the record could you
confirm that you are retrieving one or more rows when you issue the
following SQL:
SELECT * FROM `employee` WHERE `status` IS NULL;
if you are getting no rows back then the obviously updating based on the
status
Hi there everyone,
I am building a dynamic MySQL query for a project I am working on, but there
are instances where it products WHERE AND instead of WHERE city etc .. due
to the nature of the system I am developing. My question is, how can I
remove the FIRST AND from a string if it is
On Tuesday 04 January 2005 10:46, Chris Payne wrote:
I am building a dynamic MySQL query for a project I am working on, but
there are instances where it products WHERE AND instead of WHERE city etc
.. due to the nature of the system I am developing. My question is, how
can I remove the FIRST
Quite so, you're my new hero.
-James Ferrara
Jochem Maas wrote:
Norland, Martin wrote:
...
4) you thought this was [EMAIL PROTECTED]
that's simply hilarious! :-)
thanks Martin for making me laugh!
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit:
one simple trick is to use a clause that always evaluates correctly. For
example, in my site I don't delete data, but flag it with a field
(record_deleted) which defaults to 'No' (actually 0) and can be set to 'Yes'
(again 1) so that all queries are built with the requirement to use AND
ie
Hi Everybody ,
Daffodil DB Migration tool provide import/export from a database to
another. It is available at http://www.daffodildb.com/download/index.jsp and
comes with One$DB and DaffodilDB . Use DaffodilDB Browser to import and
export purpose.
Regards,
Manoj Kr. Sheoran
13 matches
Mail list logo