php - LEFT JOIN in MySQL does not work right -
i have trouble getting right result * left join.
i have 2 tables
crist | id | tex
and
izteg | id | crist_id | ip
i want replace tex
first table taking second table using crist_id
i tried following, not working:
$connect = mysql_connect($hostname, $dbuser, $dbpass)or die(mysql_error()); mysql_select_db($dbname,$connect); $sql = "select id,tex izteg left join izteg on izteg.id = crist.crist_id"; $zaqvka = mysqli_query($connect, $sql) or die (mysql_error()); while($row = mysqli_fetch_array($qry)) { echo "sad"; echo $row['tex']; echo $row['crist_id']; }
i may missing obvious
try using this: join crist table
not same , crist
table not have crist_id
how can join on that.
select crist_id,tex izteg left join crist on izteg.crist_id = crist.id;
use this:$zaqvka in while not $qry
while($row = mysqli_fetch_array($zaqvka)) { echo "sad"; echo $row['tex']; echo $row['crist_id']; }
Comments
Post a Comment