|
Posted by eholz1 on 11/22/06 16:06
On Nov 21, 1:23 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> eholz1 wrote:
> > Hello Again,
>
> > Thanks for checking my post. Well, as to errors - I am not getting
> > any. I will double check the php page that is supposed to access the
> > db.
> > I do a "SELECT * FROM pet" and display about 10 records. I will double
> > check to see if I do any error checking, etc.
>
> > Below is the php code to connect to the database:
> > <table class="maintable" border=1>
> > <tr class="rowbar"><th>Pet Name</th><th>Owner</th><th>Pet
> > Type</th><th>Gender</th><th>Date of Birth</th></tr>
> > <?php
> > // connect
> > require_once('DB.php');
> > $db = DB::connect("mysql://abc:password@myserver/menagerie");
> > $dbhost = 'myserver';
> > $dbuser = 'abc';
> > $dbpass = 'password';
>
> > if (DB::iserror($db))
> > die($db->getMessage());
> > //else
> > // echo 'Congratulatons! Connected to Database!<br></br>';
>
> > ?><!--center-->
> > <?php
> > $sql = "SELECT * FROM pet";
> > $q = $db->query($sql);
> > if (DB::iserror($q)) {
> > die($db->getMessage());
> > }
>
> > // generate the table
> > while ($q->fetchInto($row)) {
> > ?>
> > <tr>
> > <td><?= $row[0] ?></td>
> > <td><?= $row[1] ?></td>
> > <td><?= $row[2] ?></td>
> > <td><?= $row[3] ?></td>
> > <td><?= $row[4] ?></td>
> > </tr>
> > <?php }
> > ?>
> > </table></center>
>
> > This code works fine when I am running the older Apache (2.0), and PHP
> > 4.3.9.
>
> > Thanks,
>
> > ericOne other thought. Do you get anything if you add the following to the
> start of your PHP code?
>
> error_reporting(E_ALL);
> ini_set('error_reporting', E_ALL);
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================
Hello Jerry,
I figured something out - I followed your suggestion and switched the
db access code from the "pear" format
to std mysql calls (mysql_connect($a,$b,$c) etc) and can return
records, etc. I will guess that there is something not
quite right inregard to my use of the Pear db and this latest version
of PHP. I will check that out.
Thanks for helping.
eric
[Back to original message]
|