RE: [PHP-DB] query help

2010-11-17 Thread Ashay Chaudhary
The most performant methods are to use well parameterized stored procedure or a prepared parameterized statement. : Ashay -Original Message- From: Niel Archer [mailto:n...@chance.now] Sent: Wednesday, November 17, 2010 6:30 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] query help

RE: [PHP-DB] query help

2010-11-17 Thread Constantin Brinzoi
rom: Artur Ejsmont [mailto:ejsmont.ar...@gmail.com] Sent: 17 noiembrie 2010 16:07 To: Vinay Kannan Cc: PHP DB; php mysql Subject: Re: [PHP-DB] query help well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get

Re: [PHP-DB] query help

2010-11-17 Thread Niel Archer
> Hello PHP Gurus, > > I need your help on an insert query. > > I wanted to know if there is way to insert an array of values into a DB. An > eg would explain this better : > > If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 columns > > I was thinking of having a single functi

Re: [PHP-DB] query help

2010-11-17 Thread Max E.K
From: "Vinay Kannan" To: "PHP DB" , "php mysql" Sent: Wednesday, November 17, 2010 2:51:35 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna Subject: [PHP-DB] query help Hello PHP Gurus, I need your help on an insert query. I wanted to know if there is way to insert an arra

Re: [PHP-DB] query help

2010-11-17 Thread Bastien Koert
On Wed, Nov 17, 2010 at 8:51 AM, Vinay Kannan wrote: > Hello PHP Gurus, > > I need your help on an insert query. > > I wanted to know if there is way to insert an array of values into a DB. An > eg would explain this better : > > If I have 2 tables in a DB, 1) users has 3 columns 2) hobbies = 5 co

Re: [PHP-DB] query help

2010-11-17 Thread Artur Ejsmont
well i guess you could do that. but it gets complicated after a while and there will be a lot of work and probably after a while you will get into some problems. You have to handle escaping, special types etc. Then what about performance? how to query the data ... using similar approach or is

RE: [PHP-DB] Query Help...

2003-03-10 Thread NIPP, SCOTT V (SBCSI)
: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Query Help... - Original Message - From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 9:23 AM Subject: [PHP-DB] Query Help... > I am having a lot of trouble with a query that

Re: [PHP-DB] Query Help...

2003-03-10 Thread Rob Bryant
- Original Message - From: "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 9:23 AM Subject: [PHP-DB] Query Help... > I am having a lot of trouble with a query that works fine from a > basic SQL command line, but fails in my web script. Her

RE: [PHP-DB] Query Help...

2003-03-10 Thread George Pitcher
Scott, 'Group' is a reserved word so you can't use it for a column name. try changing it to 'groups' or soething else that makes sense but is safe. George > -Original Message- > From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] > Sent: 10 March 2003 5:24 pm > To: '[EMAIL PROTECTED]'

RE: [PHP-DB] Query Help

2001-12-17 Thread Rick Emery
Well, there's two ways I can think of: 1) SELECT category FROM table ORDER BY category; Then cycle through the returned list of categories and assign the category to $category. For each category, do: SELECT * FROM table WHERE category=$category ORDER BY minor_category; 2) SELECT * FROM table

Re: [PHP-DB] Query help

2001-11-19 Thread Dobromir Velev
al Message- From: Matt Williams <[EMAIL PROTECTED]> To: Andrey Hristov <[EMAIL PROTECTED]> Cc: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Monday, November 19, 2001 10:26 Subject: RE: [PHP-DB] Query help >This doesn't work either. > >SELECT count(freerooms.r

RE: [PHP-DB] Query help

2001-11-19 Thread Matt Williams
This doesn't work either. SELECT count(freerooms.room), WEEK(MAX(booking.date),1), WEEK(MIN(booking.date),1) as total FROM freerooms LEFT JOIN booking USING(room); > > All good so far > > now if I run this > > > > SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) > FROM freero > > om

Re: [PHP-DB] Query help

2001-11-16 Thread Andrey Hristov
PROTECTED]> Sent: Friday, November 16, 2001 5:32 PM Subject: Re: [PHP-DB] Query help > SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero > oms f, booking b; > > will be > SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero >

Re: [PHP-DB] Query help

2001-11-16 Thread Andrey Hristov
SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero oms f, booking b; will be SELECT count(f.room),WEEK(MAX(b.date),1), WEEK(MIN(b.date),1) FROM freero oms f LEFT JOIN booking USING(room) b; room is the field which connects two tables. If it has different name change it in