select of 2 tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hmsg
Forum Commoner
Posts: 42
Joined: Sun May 14, 2006 9:48 am

select of 2 tables

Post by hmsg »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi.
 
   I'm having problems on  showing results of a query opf mysql including 2 tables:

Code: Select all

<?php
        //the select syntax of the select is ok(i've tried directly on mysql shell and it work) so my problem is in the echo. My tables are buy_requisition and fornecedor.
        $dados = mysql_db_query("DB1",$sql_select);
        while($registo=mysql_fetch_array($dados)){
            echo $registo['buy_requisition.indice'];
            echo $registo['fornecedor.name'];
        }
?>
Is the syntax of the echo ok? What i'm doing wrong?

With the best regards.

HMSG


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The general concept of what you are doing is fine, but without seeing the query you are using it's impossible to tell you if you are doing it correctly.
Post Reply