Re: problems with a select query in informix
| From: | stephan dot schoell at chhos dot mail dot abb dot com | Date: | Wed, 05 Jul 2000 14:01:36 +0000 |
| Subject: | Re: problems with a select query in informix | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4934@lists.php.net to get a copy of this message | ||
Interesting! I've had the same problem with mysql on apache/cobalt linux. the
mysql function max() returned 0 no matter what data was in the table. Locally on
my Win95/apache/mysql system, everything worked fine. My solution (also very
ugly and slow but...): I made a loop through all the rows and looked for the max
value in my php script.
$max=0;
while ($row=mysql_fetch_array(......)) {
if ($max<$row['whatever_value']) {$max=$row['whatever_value']}
}
I'm sure, there are better solutions, either in mysql or in php.
--Steff
webmaster@posh.ch
www.posh.ch
hello, I got a problem, and I think it has to do with my low knowledge about
how php treats arrays.
What I do is this:
1) I do an insert to the articulo table with some data.
2) I run the hack below to read the biggest integer in articulo.a_id for
later use. articulo.a_id is a SERIAL.
$q_id_identi=ifx_query("SELECT MAX (a_id) FROM articulo",$conn_id);
$q_ar_identi=ifx_fetch_row($q_id_identi);
echo(sprintf("<br> %d <br>",$q_ar_identi[a_id]));
The problem is that the echo you see above give me 0. But if I make the query
directly in dbaccess (an informix program which lets throw querys) and the
answer is diferent.
What am I doing wrong???
--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Mart?n Marqu?s email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net