Re: No data being found
| From: | Marek Kilimajer | Date: | Wed, 22 Jan 2003 15:41:10 +0000 |
| Subject: | Re: No data being found | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132614@lists.php.net to get a copy of this message | ||
Are you getting no data from database or the script does not output anything (not even html)?
Roddie Grant wrote:
I have a small site in development which takes details of coming church services from a MySQL database. This bit is at the bottom of http://www.rugbyurc.org.uk/spirit/spirit_intro.php (hosted by an ISP) and works fine. I've just got OSX working on my Mac and want to get the site running on that so that I can develop it further. I am using the code below (this is a much reduced version of what's on the live site), but getting no data. Nor am I getting any error message. I can access and use the database from Terminal. I can also get the data from the same query using Lasso (a middleware program similar to php), so I know the data is there to be found. Any suggestions about why the data is not showing up in the browser with php will be much appreciated. <table border="0"> <?php $userName='xxx'; $pswd='yyy'; error_reporting(E_ALL); require_once('DB.php'); $db = DB::connect("Mysql://$userName:$pswd@127.0.0.1/rurcdb"); if (DB::iserror($db)) {die($db->getMessage());} $sql = "SELECT speaker FROM rurcdb.diary"; $q = $db->query($sql); if (DB::iserror($q)){die($q->getMessage());} while ($q->fetchInto($row)){echo "<tr><td>".($row[0])."</td></tr>";} ?> </table> Roddie Grant roddie@myword.co.uk