Results 1 to 10 of 10

Threaded View

  1. #8
    Join Date
    Nov 2023
    Location
    Hounslow
    Posts
    92
    Plugin Contributions
    0

    Default Re: need to add data to a new database table on creat account sucsess but how?

    I can't get the below to work nothing is inserted in to the database,


    can you help me on this please.




    this is the code I have in includes\classes\observers\class.bh_products_viewed_counter.php
    PHP Code:
    <?php
    /** * @copyright Copyright 2003-2022 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version $Id: DrByte 2020 Jul 28 Modified in v1.5.8-alpha $ * * Designed for v1.5.7 */
    class bh_products_viewed_counter extends base{    function __construct()    {        $this->attach($this, array('NOTIFY_PRODUCT_VIEWS_HIT_INCREMENTOR'));    }        function update(&$class$eventID$paramsArray = array())    {        global $db;
            
    $sql "INSERT INTO `ctgvzfpjxs`.`customers_browsing_history` AS `customers_browsing_history`        (`products_id`, `customers_id`, `date_added`)        VALUES (" . (int) $paramsArray ", " . (int) $_SESSION['customer_id'] . ", now())";        $res $db->Execute($sql);    }
        }


    this is the code I have in admin\includes\extra_datafiles\browsing_history_database_tables.php
    and in includes\extra_datafiles\browsing_history_database_tables.php
    PHP Code:
    <?php
    /** * browsing history Database Table Name Definitions. * * @package     browsing history * @author      Simon * @copyright   Copyright 2023-2024 Simon * @copyright   Portions Copyright 2003-2006 Zen Cart Development Team * @copyright   Portions Copyright 2003 osCommerce * @link         * @license     http://www.gnu.org/copyleft/gpl.html   GNU Public License V2.0 * @version     $Id: browsing_history_database_tables.php 07-03-2024 Simon $ */
    if (!defined('DB_PREFIX')) {    define('DB_PREFIX''');}
    define('TABLE_BROWSING_HISTORY'DB_PREFIX 'browsing_history');define('TABLE_CUSTOMERS_BROWSING_HISTORY'DB_PREFIX 'customers_browsing_history');
    this is the database table
    Click image for larger version. 

Name:	Screenshot 2024-03-21 075955.png 
Views:	16 
Size:	23.1 KB 
ID:	20537
    Attached Images Attached Images  
    Last edited by OJ_SIMON; 21 Mar 2024 at 09:07 AM.

 

 

Similar Threads

  1. Restored Data in New Database but not showing
    By guyhancock in forum Upgrading from 1.3.x to 1.3.9
    Replies: 4
    Last Post: 19 Aug 2010, 11:49 AM
  2. how to show data from database table?
    By jibon in forum General Questions
    Replies: 1
    Last Post: 20 Oct 2009, 05:36 PM
  3. Register creat new account visual module?
    By marcopolo in forum General Questions
    Replies: 3
    Last Post: 9 Apr 2009, 07:46 PM
  4. Urgent Help!!----- Cant creat new account?
    By timzhou in forum Managing Customers and Orders
    Replies: 8
    Last Post: 27 Sep 2008, 09:47 PM
  5. How to insert data into a new table
    By MCanes in forum General Questions
    Replies: 3
    Last Post: 19 Feb 2008, 11:19 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