osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Please explain tep_db_query() format

This is a discussion on Please explain tep_db_query() format within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; 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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 01-24-2005, 07:56 PM
New Member
 
Join Date: Jan 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dhobson
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 01-25-2005, 08:09 AM
Active Member
 
Join Date: May 2003
Posts: 148
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
Arpit
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 01-25-2005, 03:59 PM
New Member
 
Join Date: Jan 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dhobson
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 01-26-2005, 07:47 AM
New Member
 
Join Date: Jan 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
dhobson
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 01-26-2005, 08:03 PM
developer_x's Avatar
Active Member
 
Join Date: Nov 2004
Location: Digital Infoway
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
developer_x
Default

Yeah it is. You dont' have to define cd and c some where else except the query you pasted in your thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 04:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax