Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Kevin Murphy
I think I have it all figured out now, so as promised, here is the code. Thanks everyone for your suggestions. $id_query = "select id from WHERE id LIKE '$post_date%' ORDER BY DESC LIMIT 1 "; $id_results = mysql_query($id_query,$conn); $id_row = mysql_fetch_array($id_results); $id_num_rows

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Kevin Murphy
Thanks for the info, but I think you are misunderstanding what I am trying to do. I am simply trying to create a sequential ID based on a Date and a Letter (or number, if I have to) field that will be used as part of the link. After they are created, they will not change. And Its not about

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Björn Bartels
hello there, i had to deal with such an issue for labeling job-tickets -– (yymmdd.nn) so maybe try this... // today‘s date : "yymmdd" $use_akt_Datum = date("ymd"); // how many jobs (artikels) are there today ? $HeutigeAuftraegeSQL = "SELECT * FROM auftrag WHERE Auftragsnummer LIKE '".$use_a

Re: [PHP] Re: Incremental Date Based ID

2006-03-08 Thread Paul Novitski
At 05:05 PM 3/7/2006, Kevin Murphy wrote: Well, part of the issue is that I want to be able to use this as part of the link: /news.php?article=2006-03-05a /news.php?article=2006-03-05b With respect, I too think you should re-examine your reasons for wanting to number (or letter) the links co

Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Miles Thompson
At 09:05 PM 3/7/2006, Kevin Murphy wrote: Well, part of the issue is that I want to be able to use this as part of the link: /news.php?article=2006-03-05a /news.php?article=2006-03-05b which i will eventually do a htacess rewrite to make it look like /news/2006-03-05a.php /news/2006-03-05a.ph

Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Gerry Danen
Should have read the whole thread first, I guess... :) Gerry http://groups.yahoo.com/group/php_and_mysql/ On 3/7/06, Shaunak Kashyap <[EMAIL PROTECTED]> wrote: > A possible solution: > > Make a composite primary key where the first field is the date and the > second field would be of type enumera

Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Gerry Danen
Kevin, You can do it with a Unix timestamp, but that would just confuse the issue. Have you considered using two fields instead of one? An article ID and and article sub-ID would be retrieved as article ID = date, and all sub-ID's descending. The first record in the list would contain the highest

RE: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Shaunak Kashyap
, please notify the sender by reply e-mail and destroy all copies of this transmission. > -Original Message- > From: Kevin Murphy [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 07, 2006 5:06 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Re: Incremental Date Based ID

Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Chris
Kevin Murphy wrote: Well, part of the issue is that I want to be able to use this as part of the link: /news.php?article=2006-03-05a /news.php?article=2006-03-05b which i will eventually do a htacess rewrite to make it look like /news/2006-03-05a.php /news/2006-03-05a.php I don't think I ca

Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Kevin Murphy
Well, part of the issue is that I want to be able to use this as part of the link: /news.php?article=2006-03-05a /news.php?article=2006-03-05b which i will eventually do a htacess rewrite to make it look like /news/2006-03-05a.php /news/2006-03-05a.php I don't think I can do that with just t

[PHP] Re: Incremental Date Based ID

2006-03-07 Thread Al
Kevin Murphy wrote: I'm trying to set up an ID field that works like this for news articles that are posted to a website. 2006-03-05a 2006-03-05b I know how to generate the date, and I am pretty sure I can generate the letter code based on counting the number of rows and then assigning the n