[PHP-DB] Re: MYSQL-Search for duplicates

2002-05-06 Thread Lutz Brückner
Hi, this is a way to find dupes with sql SELECT id, year, COUNT(*) AS cnt FROM table GROUP BY id, year HAVING cnt1 Lutz [EMAIL PROTECTED] (J. Wharton) writes: Does anyone know of any built-in functions (either in PHP or MySQL) that can search for duplicates in a table according to 2

[PHP-DB] Re: Join?

2002-04-09 Thread Lutz Brückner
Hi Volker, after studying your code (not so easy to find without formating and lots of html), I think what you want to do is somthing like this: $abfrage = 'SELECT A.id AS aid, A.autor AS aauthor, A.zeit,AS azeit' .' A.betreff AS abetreff, A.inhalt AS ainhalt,'

[PHP-DB] Re: Advanced. Optimizing querry performance on a huge db with over 2.5 million entries

2002-03-29 Thread Lutz Brückner
Hi Andy, it is difficult to give you an advice without the knowing about how you are searching the database. But if you have to search through all entries, it was a bad decision to split them up into 250 tables. Some other hints: You are lost without an index, because mysql have to do a full

[PHP-DB] Re: Newbie? - help inserting into firebird1.0

2002-03-26 Thread Lutz Brückner
Hi Jon-David, not sure that this is the only problem, but rewrite your query like this (single quotes araound the values): $query=insert into BUGS (APP, APP_VERSION, BUILD, OS, SEVERITY, BUG_PRIORITY, BUG_STATE, SB_USER, STEPS, EXPECTED,

Re: [PHP-DB] Re: Newbie? - help inserting into firebird1.0

2002-03-26 Thread Lutz Brückner
if APP_VERSION is defined as decimal you can not insert a string. So leaving away the quotes around $numVersion should bring you closer. Lutz [EMAIL PROTECTED] (Jon-David Schlough) writes: you're right Lutz, that is not my only problem- turns out this statement is wrought with errors :| i

[PHP-DB] Re: Speed Up Code?

2002-03-25 Thread Lutz Brückner
Hi Jeff, the most important rule you should follow: don't query the database in a loop to avoid a join! The following lines (maybe some changes are necesary) will do the same job as your code, but considerable faster. Especially if 'id' is an index in both tables. Lutz $sql = 'SELECT u.id,

Re: [PHP-DB] Re: LEFT JOIN in UPDATE

2002-02-04 Thread Lutz Brückner
[EMAIL PROTECTED] (Adv. Systems Design) writes: I was simply going by the docs themselves: http://www.mysql.com/doc/A/N/ANSI_diff_Sub-selects.html (see bottom of page) yes, using REPLACE may be a solution. But you have to make a copy of the original table, because REPLACE cannot access the

[PHP-DB] Re: LEFT JOIN in UPDATE

2002-02-03 Thread Lutz Brückner
[EMAIL PROTECTED] (Adv. Systems Design) writes: Question is how to properly form a LEFT JOIN using UPDATE... I tried: UPDATE product_price LEFT JOIN temp SET product_price.product_price_vdate = 1 (del flag) ON product_price.product_id = temp.product_id WHERE temp.product_id IS NOT NULL