Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 5 of 5

Thread: Please explain tep_db_query() format

  1. #1
    dhobson
    Guest


    Default Please explain tep_db_query() format

    Can someone please explain the tep_db_query() function format? In this code snippet:
    $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . $current_category_id . "' and cd.categories_id = '" . $current_category_id . "' and cd.language_id = '" . $languages_id . "'");

    why are cd. and c. used instead of the full table names? Also, what about "cd where c.categories_id".

    The cd. and the c. are supposed to be table names, but I can't find where they are defined no matter how much I search.

    Please point me to a tutorial or ref man if you know of one also.

  2. #2
    Arpit
    Guest


    Default

    cd, and c are not table names, they r alias, keeps the query looking short and neat, for more info look here:

    http://dev.mysql.com/doc/mysql/en/legal-names.html

    table names are defined in catalog/includes/database_tables.php, the function "tep_db_query" itself can be found in catalog/includes/functions/database.php

  3. #3
    dhobson
    Guest


    Default

    Thank you. And yes, they are alias' but where do you define them in oscommerce. I don't see cd, and c and i've been searching.

  4. #4
    dhobson
    Guest


    Default

    [quote="dhobson"]Thank you. And yes, they are aliasIs this the code snippet that creates the definition? TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd

  5. #5
    developer_x
    Guest


    Default

    Yeah it is. You dont' have to define cd and c some where else except the query you pasted in your thread.

Similar Threads

  1. Please Explain ?????
    By learoypc in forum osCMax v2 Features Discussion
    Replies: 2
    Last Post: 09-26-2006, 09:21 PM
  2. How do you print the results of tep_db_query()
    By dhobson in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 01-27-2005, 08:43 AM
  3. Explain "quantity" number with added text?
    By petrea in forum osCommerce 2.2 Modification Help
    Replies: 2
    Last Post: 06-13-2004, 01:51 PM
  4. can someone explain how to adapt regular osc boxes to..
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 03-10-2004, 02:55 PM
  5. PLEASE explain how I can use the BTS (basic template system)
    By lucius in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 10-23-2003, 06:51 PM

Bookmarks

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
  •