sfx Posted March 19, 2004 Report Share Posted March 19, 2004 Hai all! Kaa iisti panjemt no mysql resultu ja pieprasiijumu prasu no vairaakaam tabulaam? conn_db(); $query = "SELECT * FROM news1 WHERE id=$id"; $result = mysql_query ($query) or die ("Query failed"); while($row=mysql_fetch_row($result)){ ... } $query = "SELECT * FROM news2 WHERE news1_id=$id"; $result = mysql_query ($query) or die ("Query failed"); while($row=mysql_fetch_row($result)){ ... } Man vaig lai es vinju vareetu shaadi izdrukaat :unsure: print("$news1, $news2"); Link to comment Share on other sites More sharing options...
Aleksejs Posted March 19, 2004 Report Share Posted March 19, 2004 A kāpēc nevar taisīt SELECT * FROM news1, news2 WHERE id=$id AND news1_id=$id Link to comment Share on other sites More sharing options...
bubu Posted March 19, 2004 Report Share Posted March 19, 2004 tur jau driizaak derees "SELECT * FROM news1 WHERE id=$id UNION SELECT * FROM news2 WHERE news1_id=$id" tikai, ja news1 un news2 tabulu kolonnu struktuura sakriit, bet vispaar kas liedz salasiit, veertiibas no pirmaa pieprasiijuma $news1 mainiigajaa, un veertiibas no otrajaa mainiigajaa $news2 un tak tik laimiigi drukaat aaraa. vai tad tas tik sarezhgjiiti daraas, a? Link to comment Share on other sites More sharing options...
Recommended Posts