Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Posts
    99
    Plugin Contributions
    0

    Default script explanations

    Hi All
    I'm trying to get my head around querying the database for a new page I'm trying to add. If anyone can direct me to a decent tutorial I'd appreciate it.

    I keep coming across lines like the one below. The book I'm using doesn't explain the -> part. What is this saying?

    if ($zone->RecordCount() > 1) .... etc

    Thanks
    Steve

  2. #2
    Join Date
    Sep 2008
    Posts
    99
    Plugin Contributions
    0

    Default Re: script explanations

    Just done some more reading.

    I'm assume it's using the function Recordcount on $zone? Is that right?

  3. #3
    Join Date
    Sep 2008
    Posts
    99
    Plugin Contributions
    0

    Default How to start executing queries

    Hi All
    I'm trying to learn how to query the database from my site. I've a new page as shown below and am copying examples from other functions and hacking the bits together using the PHP/MySQL manual but I've not yet achieved anything. Where am I going wrong? Be gentle with me.
    Thanks, Steve


    HTML Code:
    <div class="centerColumn" id="seller_admin">
    <h1 id="sellerAdminHeading"><?php echo HEADING_TITLE; ?></h1>
    
    <div id="sellerAdminMainContent" class="content">
    <?php
      require($define_page);
    ?>
    </div>
    
    <div>
    <?php
    global $db;
    $customer_name = $db->Execute("SELECT customers_firstname FROM customers WHERE customers_ID = '4' ");
    echo ($customer_name);
    ?>
    </div>
    
    <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
    </div>

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: script explanations

    Quote Originally Posted by sjk1000 View Post
    Just done some more reading.

    I'm assume it's using the function Recordcount on $zone? Is that right?
    Yes, it is using the "method" of the database class to do that.
    If you want, you can read more about PHP class, methods, ....
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    Sep 2008
    Posts
    99
    Plugin Contributions
    0

    Default Re: script explanations

    Thanks for the response yellow. Back to the manual... : )
    Cheers, Steve

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: script explanations

    .

    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.

  7. #7
    Join Date
    Sep 2008
    Posts
    99
    Plugin Contributions
    0

    Default Re: script explanations

    Perfect. Thank DrByte.
    Steve

 

 

Similar Threads

  1. Script
    By Prellyan in forum General Questions
    Replies: 0
    Last Post: 11 Nov 2006, 05:44 AM
  2. Premature end of script headers: php-script
    By doubletiger in forum General Questions
    Replies: 8
    Last Post: 2 Jul 2006, 09:53 PM

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