I've got a real weird problem happening after building 4.0.4pl1 and mysql
3.23.32 on my test machine.   I previously had 4.0.1 up and running with an
earlier version of mysql - I think it was 3.22.xx - and this combination
worked fine.

I *seem* to successfully connect to my mysql database... it's not returning
any error.... but it's not returning any data either.

PHP was configed with:

./configure' '--with-apache=/root/Apachetoolbox/apache_1.3.17'
'--enable-exif' '--enable-memory-limit=yes' '--enable-track-vars'
'--with-calendar=shared' '--enable-safe-mode' '--enable-magic-quotes'
'--enable-trans-sid' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx'
'--enable-yp' '--enable-sockets' '--with-gd=/usr/local'
'--enable-gd-imgstrttf' '--with-mysql' '--with-mysql' '--with-pgsql'
'--with-ldap'

And compiled and installed fine into 1.3.17 (as far as I could see)....but
I'm not getting any results out of it.

I can force an error on the connect to the database by supplying a bad
userid - so it must be talking to mysqld fine...  but I get no data out of
it, and no errors.

Here's an example of the code which is accessing the database - the database
open is handled by a separate function:

function ThePrice($prodid,$typ)
{
        $inqSQL="select * from pricing where ProdCode ='" . $prodid . "' and
Price_effDate<='".date("Y m d")."' order by price_effdate desc";
        echo "<!-- " . $inqSQL . " -->\n";
        $result = mysql_db_query("thedbname",$inqSQL);
        if (!$result) {
                echo mysql_error();
                exit;
        }
        $rtnvalue = "!?";

        if ($row = mysql_fetch_array($result)) {
                if ($typ=="S")
                        $rtnvalue = $row["ProdSetup"];
                else
                        $rtnvalue = $row["ProdMonthly"];
        }

        mysql_free_result($result);
        echo "<!-- product: $prodid Type: $typ Price: $rtnvalue .  -->\n";
        return($rtnvalue);
}

$rtnvalue shows up as the default value !?.  Sometimes.  Sometimes they show
up blank.  It's almost like the script is dying, but not telling me it's
dying.

The database fields are setup like this:

mysql> describe pricing;
+---------------+--------------+------+-----+------------+----------------+
| Field         | Type         | Null | Key | Default    | Extra          |
+---------------+--------------+------+-----+------------+----------------+
| ID            | int(11)      |      | PRI | NULL       | auto_increment |
| ProdCode      | varchar(50)  |      |     |            |                |
| Price_effdate | date         |      |     | 0000-00-00 |                |
| ProdSetup     | double(16,4) |      |     | 0.0000     |                |
| ProdMonthly   | double(16,4) |      |     | 0.0000     |                |
+---------------+--------------+------+-----+------------+----------------+
5 rows in set (0.00 sec)

So the field names do match... and mysql will return values when I select
the rows from it directly.

Does anyone have any suggestions???  As near as I can tell mysql_fetch_array
is failing - but there is a return result otherwise I'd be getting an error
message out of this routine...

I'm really confused here.

Is my build bad?  Or is this 4.0.4pl1 version a little different?



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to