Loading ...
Sorry, an error occurred while loading the content.

win32 mysql and perl = cant connect..STILL

Expand Messages
  • Adrian Fischer
    Hi Guys, Ive been away for a while and was hoping htat everything would work by some miracle when I got back but alas...it doesnt. I have set up my pc with
    Message 1 of 1 , Jul 1, 2001
    • 0 Attachment
      Hi Guys,

      Ive been away for a while and was hoping htat everything would work by some
      miracle when I got back but alas...it doesnt.

      I have set up my pc with activestate perl, mysql, php and apache server.
      All four work fine and perl and and apache work fine together as does php,
      mysql and apache but I cant get perl and mysql to work together. I can
      access mysql ok and my php,mysql prog (using phpadmin) accesses the mysql db
      that I want but not via perl. Having said that..it doesnt throw and error
      in cnnecting to the db ( I think) so perhaps its not what I think.

      I get this error:
      <snip>
      Can't call method "prepare" on an undefined value at... (refering to the
      'prepare' statement)
      </snip>
      when I run this bit of code:
      <snip>
      $db = &dbconnect;
      $db_query = "SELECT rewardName,rewardCity,rewardRefers FROM tblReward WHERE
      rewardRefers >=1 ORDER BY rewardRefers DESC";
      $dbh=$db->prepare($db_query);
      $varReturnResult = $dbh->execute();
      </snip>
      using this connect string:
      <snip>
      ####CONNECT
      sub dbconnect {
      $db = DBI->connect($config{'connectstring'}, $config{'dbusername'},
      $config{'dbpassword'});
      return $db;
      </snip>

      This same bit of code works fine on my www hosted site but not locally. I
      thought it may have been the connect string but Ive fiddled with that to no
      avail. Im stumped!!!

      Any and all ideas would be appreciated

      Thanks

      Adrian Fischer
    Your message has been successfully submitted and would be delivered to recipients shortly.