connection to the database
$dbc = mysqli_connect('localhost','root','','') OR die('ERROR :'.mysqli_connect_error());
over here i am using 3 tables,
i want to output name, taluka, village, crop grown
where taluka=talukainvest, village=villageinvest, cropgrown=cropgrowninvest
and i want this to display in a table form kind of on the php page using browser.
$z = "SELECT f.farm_id,
r.name,
f.village,
i.talukainvest,
i.cropgrowninvest
FROM
farm f
JOIN interest i
ON f.village = i.villageinvest
JOIN registration r
ON f.farm_id = r.reg_id
WHERE f.taluka = i.talukainvest AND
f.cropgrown = i.cropgrowninvest";
$y = mysqli_query($dbc,$z);
$x = mysqli_fetch_assoc($y);
if ($x) {
echo 'id :'.$x['farm_id'].'name :'.$x['name'].'village :'.$x['village'].'taluka :'.$x['talukainvest'].'crop grown :'.$x['cropgrowninvest'] ;
}
else{
echo'queries error'.mysqli_error($dbc);
}
i tried to test this but its not working.
is there any alternate way than what i have done?if this is not efficient. newbie learning and you guys are helping alot in this.