Jump to content

sql yog..help pls


Recommended Posts

okay so my current problem is my table only shows this

 

photo 1..

 

this is the code

 

this is the one need to be changed


<?
$query="SELECT * FROM tbllocation where districtid = '$district'";

        $result=mysql_query($query);
while($row=mysql_fetch_array($result)) { 
$code = $row['code'];
$description = $row['description'];
    $districtid = $row['districtid'];    
echo "<tr><td>$code</td>";
echo "<td>$description</td></tr>";
echo "<td>$districtid</td></tr>";


}
?>

 

 

okay based on photo 1..i need to change the districtid with description from another table that is called tbldistrict

 

photo2(tbllocation)

photo3(tbldistrict)

 

okay so i need the DESCRIPTION from tbldistrict to replace DISTRICTID as in photo 1..

 

 

how do i do the query..n the codes to display it. please teach me. im new..

post-131669-13482403581914_thumb.jpg

post-131669-13482403582119_thumb.jpg

post-131669-13482403582283_thumb.jpg

Link to comment
https://forums.phpfreaks.com/topic/263608-sql-yoghelp-pls/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.