ziedinjsh Posted February 2, 2011 Report Share Posted February 2, 2011 Zinu, ka nav kaut kas pareizi.. vai nekas nav pareizi, bet meiģināju kko.. $talk=mysql_query("SELECT AS id, talk_message, time FROM talk LEFT JOIN SELECT user_name, user_photo FROM users GROUP BY id"); while($data = mysql_fetch_array( $talk )){ echo "<div class='talk-messages'>"; echo "<div class=''>".$data['talk_message']."</div>"; echo "<div class=''>".$data['user_photo']."</div>"; echo "<div class=''>".$data['user_name']."</div>"; echo "</div>"; } protams jau neko nenolasa.. tikai izmet erroru: Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\WEB\xampp\htdocs\forums\index.php on line 60 Link to comment Share on other sites More sharing options...
Rincewind Posted February 2, 2011 Report Share Posted February 2, 2011 SELECT talk.id, talk.talk_message, talk.time, users.user_name, users.user_photo FROM talk, users WHERE talk.id=users.id (ja abām ir tāds kopējais lauks) Link to comment Share on other sites More sharing options...
daGrevis Posted February 2, 2011 Report Share Posted February 2, 2011 Centies darīt šādi... mysql_query( ... ) or exit( mysql_error() ); P.S. Protams, kad lapa ir gatava, potencionālais lietotājs nedrīkst redzēt nekādus "error'us", jo hakerim (kas ir potencionālais lietotājs) tas atvieglos lapas "izvarošanu". Link to comment Share on other sites More sharing options...
ziedinjsh Posted February 2, 2011 Author Report Share Posted February 2, 2011 SELECT talk.id, talk.talk_message, talk.time, users.user_name, users.user_photo FROM talk, users WHERE talk.id=users.id (ja abām ir tāds kopējais lauks) nū, tals tabulā ir vienkārši id bet users tabulā ir user_id Link to comment Share on other sites More sharing options...
Gints Plivna Posted February 2, 2011 Report Share Posted February 2, 2011 Ar šo piemēru vajadzētu pietikt. Gints Plivna http://datubazes.wordpress.com Link to comment Share on other sites More sharing options...
Recommended Posts