Hi all, i manage to write this query to select data from 2 different tables, here is it

$query ="SELECT * FROM illness,symptoms  WHERE symptoms.sympId =  illness.illId";

am trying to echo the result of the query, here is my script

if($med == !'')

{
    $query ="SELECT * FROM symptoms,illness WHERE symptoms.sympId = illness.illId";

    $rs = mysql_query($query);
    while($row = mysql_fetch_assoc($rs)) 

    {
        $name = $row['name'];

        $msg=urlencode($name);
        $msg = urldecode($msg);

        echo "$msg".',';
    }
}

when i run this,it select every thing from the,

symptoms

table, any good ideas will do.Thanks.

Just echo more columns like this one: $row['name']. name is the name of the corresponding column.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.