[PHP-DB] get all records but limit to 6

2004-06-14 Thread Gawie Marais
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

RE: [PHP-DB] get all records but limit to 6

2004-06-14 Thread Sunmaia
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

RE: [PHP-DB] get all records but limit to 6

2004-06-14 Thread Marcjon
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/)

Re: [PHP-DB] get all records but limit to 6

2004-06-14 Thread Torsten Roehr
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

Re: [PHP-DB] get all records but limit to 6

2004-06-14 Thread Gawie Marais
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

[PHP-DB] auto update mysql table with the current date time

2004-06-14 Thread Gawie Marais
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

[PHP-DB] Re: auto update mysql table with the current date time

2004-06-14 Thread Torsten Roehr
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

RE: [PHP-DB] auto update mysql table with the current date time

2004-06-14 Thread Sunmaia
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

[PHP-DB] Re: Mysql not receiving the data

2004-06-14 Thread Rui Cunha
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

[PHP-DB] Pass into the title meta-tag a variable from an URL Directory Manager

2004-06-14 Thread Alessandro Folghera
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

[PHP-DB] Re: Pass into the title meta-tag a variable from an URL Directory Manager

2004-06-14 Thread franciccio
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

[PHP-DB] Delete Subquery

2004-06-14 Thread Brock Jimmy D Contr 74 MDSS/SGSI
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

Re: [PHP-DB] Delete Subquery

2004-06-14 Thread Chris Bolt
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

[PHP-DB] Oracle Client Libraries for Linux

2004-06-14 Thread Peter Beckman
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

[PHP-DB] MySQL executes several times the same request

2004-06-14 Thread Loïc Moisy
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

[PHP-DB] Re: MySQL executes several times the same request

2004-06-14 Thread Justin Patrin
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