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:$[EMAIL PROTECTED]/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
[EMAIL PROTECTED]


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

Reply via email to