Re: [PHP-DB] Long running db queries and the "STOP" button

2005-10-27 Thread Jochem Maas
Bastien Koert wrote: Few things I can think of: 1. warn the user that the query may take some time and then show a splash type screen that indicates that something is happening 2. Run the whole thing in a new window without the toolbar 3. rework the query so it doesn't take so much time. If

RE: [PHP-DB] problem with mysql_error()

2005-10-27 Thread Bastien Koert
Error Message: " . @mysql_error the '@' symbol suppresses the error message...remove it bastien From: Jason Gerfen <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] problem with mysql_error() Date: Thu, 27 Oct 2005 08:43:13 -0600 I am not sure why this is not returning any value

[PHP-DB] problem with mysql_error()

2005-10-27 Thread Jason Gerfen
I am not sure why this is not returning any values but it should be. The database structure CREATE TABLE `hosts` ( `id` int(11) NOT NULL auto_increment, `hostname` varchar(100) NOT NULL default '', `mac` varchar(100) NOT NULL default '', `ip` varchar(100) NOT NULL default '', `vlan` varchar

RE: [PHP-DB] Long running db queries and the "STOP" button

2005-10-27 Thread Bastien Koert
Few things I can think of: 1. warn the user that the query may take some time and then show a splash type screen that indicates that something is happening 2. Run the whole thing in a new window without the toolbar 3. rework the query so it doesn't take so much time. If there are a lot of jo

[PHP-DB] Long running db queries and the "STOP" button

2005-10-27 Thread Thomas.Seiler
Hello list, We are working on a project where we use PHP5 inside Apache2 and run very long running queries on mysql 5 and postgresql. A single query might run up to several minutes, and generally uses 100% CPU on the database server. So far everything is fine. Now what happens, is that sometim

Re: [PHP-DB] Limited connections to the database. .

2005-10-27 Thread Jason
Sorry, I should've replied to your post first, but, have you tried manually limiting the connections via PHP? Code used from Omega Engine (Copyright Omega Vortex): $ini_data =& $engine->ini_data['file']; setup_errors(); if ($ini_data['DB']['connections'] > 5) { $engine->error = "There are too

RE: [PHP-DB] Detailed Report

2005-10-27 Thread Bastien Koert
Let the code handle the separation of the products 0) { $old_cat = ""; while ($rows = mysql_fetch_array($result)) { //handle cat changes if ($old_cat != $rows['cat']) { echo "".$rows['cat'].""; $old_cat = $rows['cat']; }//end if //echo out the dat

Re: [PHP-DB] Limited connections to the database. .

2005-10-27 Thread Jason
Norland, Martin wrote: http://www.google.com/search?q=oracle+limit+client+connections http://www.oracle.com/technology/pub/articles/php_experts/scaling_oracle _and_php.html Summary - either you're not using persistent connections, or your site is just very busy. If it's just that the site is

SV: [PHP-DB] Detailed Report

2005-10-27 Thread Henrik Hornemann
Hi, Sorry about the stupid mistakes, should ofcourse have been: $sqlstmt1 = "select category, name, code, city from table order by category"; $rs1 = mysql_query ($sqlstmt1); $category=''; while ($row1 = mysql_fetch_object ($rs1) { if ($category != $row1->category) { $category =

SV: [PHP-DB] Detailed Report

2005-10-27 Thread Henrik Hornemann
How about: $sqlstmt1 = "select category, name, code, city from table order by category"; $categry=''; while ($row1 = mysql_fetch_object ($rs1) { if ($old_category != $row1->category) { $ category = $row1->category; Print($category.""); } Print($row1->name. '-' .$

Re: [PHP-DB] Detailed Report

2005-10-27 Thread Shahmat Dahlan
Not sure whether this would be such a good idea. Does anybody else have a better one than this? #main loop, gather distinct / unique category names $sqlstmt = "select distinct(category) as category from table"; $rs = mysql_query ($sqlstmt); while ($row = mysql_fetch_object ($rs)) { print $row-

[PHP-DB] Detailed Report

2005-10-27 Thread Danny
Hi All, I´ve got a connection, to a MySQL db, and get the following ResultSet(Category | Name | Code | City) Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles Customers | Max | A36 | Paris Providers | John | A36 | London Providers | Mark | B67 | Madrid And I need the report