Jump to content

alex_funky_dj

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Posts posted by alex_funky_dj

  1. Hello,

     

    I've 2 tables with the following structure :

     

    Table 1 name : categories

    Fields : id, code, name.

     

    Table 2 name : Products

    Fields : id, category_id, code, name

     

    and here's MySQL query :

    $query="SELECT *
    FROM products
    INNER JOIN categories
    ON products.categpry_id = categories.id";
    
    $result = mysql_query($query);
    
    $row = mysql_fetch_array($result);
    

    Now, I've the problem with "echo ()" !!

    when I make :

     echo $row[name]; 

    it shows the name of product, how can I show the category name ??

    I tried

     echo $row[categories.name]; 

    but I'm having errors !!

     

    so how can I handle this ??

     

    THANK YOU FOR YOUR TIME !

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.