hi,
i need to get only the first 6 records sorted by datetime from the thousands
of records in existance. how do i do that ?
thus, only the latest 6 records added to the database should be displayed
and this can be done with the datetime field in the database. can anyone
help with the php code
select * from table order by datetime_field desc limit 0,6
Peter
-Original Message-
From: Gawie Marais [mailto:[EMAIL PROTECTED]
Sent: 14 June 2004 07:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] get all records but limit to 6
hi,
i need to get only the first 6 records sorted
I think the problem is he wants to limit after he's sorted them. The
only way I know of to do that is to do the whole query without a limit
clause, then run through the results but only do whatever you have to do
with the first 6.
--
Marcjon
--
PHP Database Mailing List (http://www.php.net/)
Marcjon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I think the problem is he wants to limit after he's sorted them. The
only way I know of to do that is to do the whole query without a limit
clause, then run through the results but only do whatever you have to do
with the first
thanx guys, it's working like a charm !!
Marcjon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I think the problem is he wants to limit after he's sorted them. The
only way I know of to do that is to do the whole query without a limit
clause, then run through the results but only
hi guys,
me again ! i need to update a record in a mysql table. now i have defined a
datetime field when a record is modified... i want to 'auto update' that
field whenever a record is modified... what would the php script be for
something like that... ?
thanx,
gawie.
--
PHP Database Mailing
Gawie Marais [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hi guys,
me again ! i need to update a record in a mysql table. now i have defined
a
datetime field when a record is modified... i want to 'auto update' that
field whenever a record is modified... what would the php script
Hi
if you change the field type to TIMESTAMP mysql will do it for you
http://dev.mysql.com/doc/mysql/en/DATETIME.html
Peter
-Original Message-
From: Gawie Marais [mailto:[EMAIL PROTECTED]
Sent: 14 June 2004 09:25
To: [EMAIL PROTECTED]
Subject: [PHP-DB] auto update mysql table
take a look at the sql insert sintaxe...
it's supposed to be: INSERT INTO table VALUES (val1,val2,...,valn);
all string and date values go between ' '...numeric values don't need
them...
here's an example: INSERT INTO table VALUES ('abc',500,'12-12-2003');
if your table has 5 fields but you
I hope that phpers will be not angry if I'm posting that maybe stupid
question.
I have the following script, an URL Directory Manager (PHP4 from Wrox Press).
I'd like to pass the variable category into the TITLE META TAG from
php_category when I select the corrispondent category_id into the URL
Wathever you are ging to do with meta tag they still are html tag, so as
long as you embend the tag in php code it shuold just work fine.
?php
echo any_html_tag attribute01=\$myattribute01\
attribute02=\$myzttribute02\
/any_html_tag;
?
Any text editor should help you modifying the
I've been able to figure how to use a delete subquery to delete all rows, but how do I
use a delete subquery to delete only one row?
I have two tables: users and roles with the following fields:
Users:
userid
roleid
Roles:
roleid
I want to be able to delete a rowid from the
How about:
DELETE FROM users WHERE userid IN (SELECT u.userid FROM users AS u
LEFT JOIN roles AS r ON (u.roleid = r.roleid) WHERE r.roleid IS NULL
LIMIT 1);
On Mon, 14 Jun 2004 11:59:25 -0400, Brock Jimmy D Contr 74 MDSS/SGSI
[EMAIL PROTECTED] wrote:
I've been able to figure how to use a
Folks --
I've been trying to figure out where the Oracle client libraries live, but
I'm confused as hell.
I've read the PHP-DB archives, and everyone keeps talking about installing
the client libraries (libclntsh et al), and how that's all you need for
Oracle 9i PHP support. Great -- but which
Hi Everyone !
I've coded a php site for a musical store. At the end of every page, before
closing the connection, I send an UPDATE request to increment a statistical
tool. Recently I saw weird results, so I tried to understand. Looking in my
logs, I saw that this request could be sent several
Loïc moisy wrote:
Hi Everyone !
I've coded a php site for a musical store. At the end of every page, before
closing the connection, I send an UPDATE request to increment a statistical
tool. Recently I saw weird results, so I tried to understand. Looking in my
logs, I saw that this request could be
16 matches
Mail list logo