Re: [PHP-DB] simple sql problem

2003-07-25 Thread Stephen March
Any database that supports nested queries (unfortunatly this excludes MySQL) ... you can do select pic_id from pictures where pic_id not in (select pic_id from album_pictures) Otherwise you might have a harder time with MySQL ... something like set difference if it supports it (I'm not

[PHP-DB] inputting datetime to mssql

2003-07-25 Thread Henrik Hornemann
Hi, I had this problem that was driving me crazy. I was trying to input a datetime to a mssql table, formated the same way as I use in all my other tables i.e d-m-Y. But no matter which variations of the basic format I tried, it didn't understand the date correctly. In desperation I tried

RE: [PHP-DB] inputting datetime to mssql

2003-07-25 Thread Ryan Marks
Henrik, It's possible that the database is interpreting your date as a couple of subtraction operations. I always use quotes or single ticks around my dates when refrencing them in SQL. Example: INSERT into some_table (date) values (2003-07-25); Give a sample of your code so that your problem

[PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread Morgan Bardon
Hi there, I have been trying to get a solution to this select query from all over the web and have found no answer so I was hoping someone here could help out. The date field of the database is imported from a text file with the date format 'dd-mm- hh:mm:ss' and I only want to display the

[PHP-DB] R: [PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread Moreno Riccardi
Try $query2 = select Title, date_format(Date,'%d-%m-%Y) as Date, Artist, Country, RecordCompany, CatalogueNumber, Composer FROM recording where title regexp '$keyword'; Hi, Moreno -Messaggio originale- Da: Morgan Bardon [mailto:[EMAIL PROTECTED] Inviato: venerdì 25 luglio 2003 17.17 A:

Re: [PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread Morgan Bardon
Thanks for that, but I get a NULL entry in the field then for all the dates. - Original Message - From: Moreno Riccardi [EMAIL PROTECTED] To: Morgan Bardon [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 25, 2003 4:34 PM Subject: R: [PHP-DB] MYSQL and PHP cast() function...

Re: [PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread CPT John W. Holmes
Thanks for that, but I get a NULL entry in the field then for all the dates. What column type is the DATE column? Also, since DATE is a reserved word in MySQL, naming a column DATE probably wasn't a good idea. If you know you always want the first 11 characters, you can always do LEFT(Date,11)

[PHP-DB] R: [PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread Moreno Riccardi
There's a mistake try this: $query2 = select Title, date_format(Date,'%d-%m-%Y') as fDate, Artist, Country, RecordCompany, CatalogueNumber, Composer FROM recording where title regexp '$keyword'; -Messaggio originale- Da: Morgan Bardon [mailto:[EMAIL PROTECTED] Inviato: venerdì 25

Re: [PHP-DB] MYSQL and PHP cast() function...

2003-07-25 Thread Morgan Bardon
I have tried the column as a varchar and timestamp but it does not work. with the Timestamp setup and DATE_FORMAT() I get 00-00- at the moment and I know that there are dates in there. The reason for this is the import changes all the field to 00 which is the TimeStamp default. I

[PHP-DB] query and display acting weird...

2003-07-25 Thread Aaron Wolski
Hi Guys, Code: echo select name=\patternThreads[]\ size=\10\ multiple style=\font-family:monospace;\\n; $query = select t.manufacturer, t.id, t.colour, t.colourID, t.type, p.thread_index FROM kcs_threads t LEFT JOIN kcs_patternthreads p ON t.id = p.thread_index WHERE p.pattern_index =

Re: [PHP-DB] query and display acting weird...

2003-07-25 Thread CPT John W. Holmes
Probably need: ORDER BY t.manufacturer, t.colourID ---John Holmes... - Original Message - From: Aaron Wolski [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 25, 2003 2:58 PM Subject: [PHP-DB] query and display acting weird... Hi Guys, Code: echo select