Re: [PHP-DB] SUM and JOIN together

2004-02-18 Thread Ignatius Reilly
Unless you are using 4.1 (which allows subqueries), you should perform 3 queries, the first 2 creating temporary tables: - sum - difference - left join Ignatius _ - Original Message - From: "rogue" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February

[PHP-DB] SUM and JOIN together

2004-02-18 Thread rogue
Hi all, Not sure how to handle this situation and was hoping someone with a bigger brain then me could help. 2 tables tbl_hoursbought id | client | hours 1 | test | 5 2 | test | 10 tbl_hoursused ---

Re: [PHP-DB] Update Statement

2004-02-18 Thread Ng Hwee Hwee
hi, thank you for your reply but I can't do a multiple table update because my server is using MySQL with version lesser than 4.0... please enlighten me how I can write the same update statement without using multiple table update.. is there a way to use JOIN or something?? thanks thanks.. hwee

[PHP-DB] Re: oracle: fetch a query result into an array

2004-02-18 Thread Justin Patrin
To make your life much easier, I recommend using PEAR DB. The function calls are very easy and work for any DBMS (no remembering DB specific calls :-)). It also gives you lots of added functionality, such as fetching of an entire result set at once, fetching only one row, or even fetching one c

[PHP-DB] Re: Interbase: How to get table structure via SQL ?

2004-02-18 Thread Justin Patrin
Dizem Pgc wrote: Hi, ...table structure without PEAR ? Is it possible to accomplish this by a sql-statement or do I really HAVE TO install this xtension (PEAR) ? Cuz I've already written a few scripts containing many function calls (self written classes, too). I read the PEAR extension organ

[PHP-DB] run some tests on mysqli, please

2004-02-18 Thread Daniel Convissor
Hi Folks: Does anyone here have the mysqli extension running correctly on their machines? If so, could you please help the PEAR DB project by running the test suite? Instructions for doing so are here: http://cvs.php.net/co.php/pear/DB/doc/TESTERS Pardon me for posting to a list I'm not o

[PHP-DB] [Attn] Re: [PHP-DB] SQLite behaving bad?

2004-02-18 Thread Gerard Samuel
On Tuesday 17 February 2004 04:41 pm, Gerard Samuel wrote: > Currently using sqlite 2.8.11 (distributed by php snaps) with php4.3.5rc2 > on windows XP. > Several months ago, I added support for sqlite in a database abstraction > class I created. It worked great then. > Im trying to see if things a

RE: [PHP-DB] oracle: fetch a query result into an array

2004-02-18 Thread Ford, Mike [LSS]
On 18 February 2004 18:22, Torsten Lange contributed these pearls of wisdom: > > while(OCIFetch($stmt)) > { > $column_name = OCIResult($stmt,'COLUMN_NAME'); missing [] here -- should be: $column_name[] = OCIResult($stmt,'COLUMN_NAME'); >

[PHP-DB] oracle: fetch a query result into an array

2004-02-18 Thread Torsten Lange
Hello, I'm a php beginner and not succeed in fetching an oracle query result into an array. I want to load the colum names of a table (from an Oracle9i) into a -field. There is something working, but only the last column name appears in the select field and is wraped by each letter. For insten

[PHP-DB] Re: Is it safe to do this?

2004-02-18 Thread Justin Patrin
Jerry wrote: That depends on what you're doing. Here's why I can't provide feedback: 1) Your code isn't at all complete, the foreach isn't even finished. Not what matters here, I just snipped a bit of code in here. I'm not even concerned about it because the code works fine. I just need some w

[PHP-DB] Interbase: How to get table structure via SQL ?

2004-02-18 Thread DiZEM PGC
Hi, ...table structure without PEAR ? Is it possible to accomplish this by a sql-statement or do I really HAVE TO install this xtension (PEAR) ? Cuz I've already written a few scripts containing many function calls (self written classes, too). I read the PEAR extension organizes everything wi

Re: [PHP-DB] Re: php/mysql weblog - addnews function problems

2004-02-18 Thread Slippyaah
I've tried playing around with it a bit but I'm getting quite confused now. It still doesn't like my declaration of variables and I'm not sure how to declare 'id' either as it isn't used in the form as a field of entry - just an index in the database. Any help would greatly be appreciated cause I'

Re: [PHP-DB] Search results of a previous query?

2004-02-18 Thread Ricardo Lopes
You can concat to the 1º filter statement the 2º. ex: SELECT * FROM atable WHERE (fieldname = fieldvalue) AND (fieldname2 = fieldvalue2) For the user to search twice in the same field i think you have to use the LIKE operator instead of the = and use the % in the string as wildcard. ex: 1º Searc

[PHP-DB] Re: Interbase: How to get table structure via SQL ?

2004-02-18 Thread pete M
Us use the PEAR db abstraction layer which has a function to do this pete Dizem Pgc wrote: Hi, does anyone know how to get the Structure of a table using SQL. (ex.: SELECT ?RELATION_SOURCE?, RDB$RELATION_NAME FROM RDB$RELATIONS) Isn't there any table containing the CREATE STATEMENT for a table? M

[PHP-DB] Search results of a previous query?

2004-02-18 Thread Lic. Carlos A. Triana Torres
Hi all, I am trying to build a script to make "nested" searches in a table. I have a form compossed of a text field and a select dropdown menu with all the fields in the table. The user can write in the text box and then select the field in which to perform the search. This works fine so far

RE: [PHP-DB] Interbase: How to get table structure via SQL ?

2004-02-18 Thread Hutchins, Richard
Sorry...just re-read the subject and realized you're using Interbase. Need coffee. ;) > -Original Message- > From: Hutchins, Richard [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 18, 2004 8:24 AM > To: 'DiZEM PGC'; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Interbase: How to get ta

RE: [PHP-DB] Interbase: How to get table structure via SQL ?

2004-02-18 Thread Hutchins, Richard
If you're using MySQL, you can use the DESCRIBE tablename command. There's a pretty straightforward (and easy to find) section on the DESCRIBE command in the MySQL documentation. > -Original Message- > From: DiZEM PGC [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 18, 2004 8:11 AM

[PHP-DB] Interbase: How to get table structure via SQL ?

2004-02-18 Thread DiZEM PGC
Hi, does anyone know how to get the Structure of a table using SQL. (ex.: SELECT ?RELATION_SOURCE?, RDB$RELATION_NAME FROM RDB$RELATIONS) Isn't there any table containing the CREATE STATEMENT for a table? Maybe I have to use another command? Please help ! Thx, DiZEM -- GMX ProMail (250 MB Mail

Re: [PHP-DB] Re: php/mysql weblog - addnews function problems

2004-02-18 Thread Doug Thompson
On Wed, 18 Feb 2004 09:35:22 -, Slippyaah wrote: >Well basically I think it's a problem with the declaration of variables >and/or the way they are being processed by the form. > >Here is the individual addNews function: > >function addNews() { > global $db; > > /* declare variables

[PHP-DB] Re: Update Statement

2004-02-18 Thread pete M
This one cooked me 2 when I realised my online by was 3x and local was 4x only 4+ supports a join on an update statement from the manual Starting with MySQL Version 4.0.4, you can also perform UPDATE operations that cover multiple tables: UPDATE items,month SET items.price=month.price WHERE it

Re: [PHP-DB] Update Statement

2004-02-18 Thread Ricardo Lopes
you could use: for ($i=0; $i< max; $i++) { mysql_query("update Table1, Table2 set Table1.field1 = Table2.field2 where Table1.no = Table2.no"); } OR if you use mysqlt daemon (support for transactions, in this case is best) mysql_query('BEGIN'); for ($i=0; $i< max; $i++) { if (! mysql_quer

[PHP-DB] Re: php/mysql weblog - addnews function problems

2004-02-18 Thread Slippyaah
Hey David, Well basically I think it's a problem with the declaration of variables and/or the way they are being processed by the form. Here is the individual addNews function: function addNews() { global $db; /* declare variables here? */ /* insert the new news entry */

[PHP-DB] Re: Is it safe to do this?

2004-02-18 Thread JeRRy
That depends on what you're doing. Here's why I can't provide feedback: 1) Your code isn't at all complete, the foreach isn't even finished. Not what matters here, I just snipped a bit of code in here. I'm not even concerned about it because the code works fine. I just need some work on a qu