[PHP-DB] connection mysql-php

2003-07-20 Thread abd_bela
I 've just read that php ver 5 doesn't supporte the mysql connection ( 
at least 4.0 ), what does that mean ? I develop and manage my database 
with php/mysql on linux.
thank for help

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] What happens when the database is down?

2003-07-20 Thread Hanxue Lee
Thank you for your answers. Perhaps I have not explained myself well 
enough. 

Firstly, I split the logic/data access code into a PHP class and the 
each HTML page is represented by a PHP file.

The PHP file will call functions such as addStaff() which will write 
all the Staff details to the database. In other words, the mysql_connect
() and other database code is in the Staff.class.php

No, I do not use the '@' sign

I use mysql_connect(...) or die(Cannot connect to database)

Therefore, if there are any problems, by right the line should be 
displayed, but it isn't.

Our client is using the latest versions of Apache, PHP and MySQL. MySQL 
4.0.12 is stable and so far I have not encountered any problems. By the 
way, the problem is those mysql_ functions just 'hang', no response. 
Not invalid response. This lead me to suspect it is some timeout 
problem. MySQL 4.0.12 is production version (latest production version 
is 4.0.13, Alpha 4.1.0). 

AFAIK, Apache 2 is around for ages, and it is easier to maintain 
compared to Apache 1.3.x (IMHO). BTW, I have not experienced any 
problem running PHP with Apache 2.

What I want to know is:
1. How come the mysql_ calls do not timeout?
2. I do not get some error displayed on the HTML page?
3. How do I set PHP and MySQL call timeouts?


Thank you very much.


Yours truly,
Hanxue




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Help... PostgreSQL on Windows 98!

2003-07-20 Thread bruno
Hi,
I'm trying to use PostgreSQL on Windows98!
Does anyone here succeded with it?

Thanks
Bruno (sorry.. my mistakes).


Re: [PHP-DB] speeing up query and display...

2003-07-20 Thread John W. Holmes
Aaron Wolski wrote:
Hi Guys,
 
I have the following query which unfortunately has to grab all records
in a table (well over 3000) to display in a multiple select box.
 
Code:
 
?php
 
$manufQuery = db_query(SELECT manufacturer FROM
kcs_threads);
while ($manufResults = db_fetch($manufQuery)) {
 
?
option value=?php echo $manufResults[manufacturer];
?/option
 
?php
 
$threadQuery = db_query(SELECT id,colour,colourID FROM kcs_threads
LIMIT 10);
while ($threadResults = db_fetch($threadQuery)) {
 
$threadselectQuery = db_query(SELECT * FROM
kcs_patternthreads WHERE pattern_index='$id');
while ($threadselectResult =
db_fetch($threadselectQuery)) {
 
?
option value=?php echo $threadResults[id]; ? ?php
if ($threadselectResult[thread_index] == $threadResults[id]) echo
checked; ??php echo $threadResults[colour]; ?/option
 
?php
 
}
}
}
 
?
 
Can ANYONE see a way to speed up the query and displaying of the
results? Take a while on High Speed and WY to long on Dialup.
Like someone else said, your nested queries approach is horrible. Here's 
the way to do it with one query.

$query = select t.manufacturer, t.id, t.colour, t.colourID, p.thread_index
from kcs_threads t LEFT JOIN kcs_patternthreads p ON t.id = p.thread_index
where p.pattern_index = $id OR p.pattern_index IS NULL;
$old_manufacturer = '';

$result = db_query($query);
while($row = db_fetch($result))
{
if($old_manufacturer != $row['manufacturer'])
{
echo option value=\\{$row['manufacturer']}/option\n;
$old_manufacturer = $row['manufacturer'];
}
echo option value=\{$row['id']}\;
echo empty($row['thread_index']) ? '' : ' selected';
echo {$row['colourID']}/option\n;
}
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php