Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default Which API is used to connect w/ MySQL?

    Hi,
    I've have a couple of questions here and they are related.

    1. Which API does ZenCart use to connect to the MYSQL database? PDO, MySQLi, or MySQL?

    Perhaps this is out of scope with what should be asked on this UG, but will ask anyway. been struggling all evening with this., big thanks

    2. I've customized the Contact Form and am trying to build a page to show the contents of the entire table. Having trouble just getting a count on the number of rows..

    $contact_form_data = $db->Execute("select * from contact_form_data");

    //$count = count($db->Execute("select * from contact_form_data")); DON'T WORK
    //$count = mysql_numrows($contact_form_data); IxNeh

    thank you,

  2. #2
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Which API is used to connect w/ MySQL?

    It uses MySQL.

    The logic you need is:
    PHP Code:
    global $db;
    $sql "select * from tablename";
    $result $db->Execute($sql);

    // optional:
    //$num_records = $result->RecordCount();

    // to loop thru the resultset:
    while(!$result->EOF) {
      echo 
    $result->fields['fieldname1'] . ' ' $result->fields['fieldname2'];

      
    // now position to the next record so the while() loop can proceed (don't forget this part or you'll have an endless loop!):
      
    $result->MoveNext();

    You'll see examples of this all over the modules and classes and functions files.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 29 Apr 2013, 05:40 PM
  2. Llinkpoint Api connect
    By marcive in forum Addon Payment Modules
    Replies: 4
    Last Post: 4 Jun 2007, 03:26 AM
  3. Advice please! Which MySql and Which PHP
    By Daves Teddy in forum Installing on a Linux/Unix Server
    Replies: 13
    Last Post: 6 Nov 2006, 04:57 PM
  4. Linkpoint API or Connect??
    By ladysaat in forum Addon Payment Modules
    Replies: 7
    Last Post: 23 Jun 2006, 12:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR