[PHPwestoz] MYOB ODBC error

Daniel Antonic daniel at dcnsolutions.net
Thu May 7 23:50:52 EST 2009


I tried the link (http://myobaustralia.custhelp.com/cgi-bin/myobaustralia.cfg/php/enduser/std_adp.php?p_faqid=30548) but that driver doesn't work with the data file of my customer (or any other that I got my hands on!) I installed that driver on my development machine which is Windows XP Pro, no other installation of MYOB.

I get a 'cannot find table' error on the code that I was using on my client's machine (Windows PX Pro, MYOB Accounting Plus v18):

<?php
# connect to a DSN "mydb" with a user and password

  
$connect = odbc_connect("test","", "");  
echo $connect . "<P>";
# query the users table for name and surname  
$query = "SELECT * FROM Employees";  


# perform the query  
$result = odbc_exec($connect, $query) or die ("cannot find table");  


# fetch the data from the database  
while(odbc_fetch_row($result)){  
  $name = odbc_result($result, 1);  
  $surname = odbc_result($result, 2);  
  print("$name $surname<br>\n");  
}
?>

When getting the raw output of the $results variable, I get a boolean(NULL) result. Does that mean the DSN isn't setup correctly?


Kind regards, 
Daniel Antonic 
Proprietor DCN Solutions 

Mob: 0438 303 429 
Web: dcnsolutions.net
  ----- Original Message ----- 
  From: Kim Richardson 
  To: PHP users in Western Australia (or nearby) 
  Sent: Wednesday, May 06, 2009 2:03 PM
  Subject: Re: [PHPwestoz] MYOB ODBC error


  I've done this previously before and from memory we had to get a MYOB
  ODBC driver to create the DSN.

  I think you can get it from here.

  http://myobaustralia.custhelp.com/cgi-bin/myobaustralia.cfg/php/enduser/std_adp.php?p_faqid=30548

  Daniel Antonic wrote:
  > Hello all
  >  
  > I'm writting a program that will interface a customer's MYOB database
  > file with her web site so that people can pay online, and it is all
  > recorded in her MYOB file immediately.
  >  
  > MYOB Accounting V18 is running in Windows XP Pro, I have set up a
  > System DSN, but PHP just cant see the database. I got this snippet of
  > code from another web site:
  >  
  > <?php
  > # connect to a DSN "mydb" with a user and password
  >  
  > $connect = odbc_connect("test","", ""); 
  > echo $connect . "<P>";
  > # query the users table for name and surname 
  > $query = "SELECT * FROM Employees"; 
  >
  > # perform the query 
  > $result = odbc_exec($connect, $query) or die ("cannot find table"); 
  >
  > # fetch the data from the database 
  > while(odbc_fetch_row($result)){ 
  >   $name = odbc_result($result, 1); 
  >   $surname = odbc_result($result, 2); 
  >   print("$name $surname<br>\n"); 
  > }
  >  
  > It fails at $result, I put in the DSN name, username and password in
  > the odbc_connect() directive. I really need help on this, please!
  >
  > Kind regards,
  > Daniel Antonic
  > Proprietor DCN Solutions
  >
  > Mob: 0438 303 429
  > Web: dcnsolutions.net <http://dcnsolutions.net/>
  > ------------------------------------------------------------------------
  >
  > _______________________________________________
  > PHPwestoz mailing list
  > PHPwestoz at lists.linux.org.au
  > http://lists.linux.org.au/listinfo/phpwestoz
  >   

  -- 
  ---------------
  Kim Richardson
  Web Applications Developer
  Viewdale IT
  Tel: 1300 799 516 - Fax: (07) 3319 8932
  http://www.ausnix.com.au


  _______________________________________________
  PHPwestoz mailing list
  PHPwestoz at lists.linux.org.au
  http://lists.linux.org.au/listinfo/phpwestoz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/phpwestoz/attachments/20090507/184eab78/attachment.htm 


More information about the PHPwestoz mailing list