Jump to content
php.lv forumi

db ?


archux

Recommended Posts

Sveiki!

 

Lieta tāda, ka es savienoju php ar msql datubāzi. Bet nesaprotu kā lai ieliek iekšā šo: album_id=$album_id

 

kods ir šāds:

 

$result = dbquery(
				"SELECT tp.*, tu.user_id,user_name, SUM(tr.rating_vote) AS sum_rating, COUNT(tr.rating_item_id) AS count_votes
				FROM ".$db_prefix."photos tp
				LEFT JOIN ".$db_prefix."users tu ON tp.photo_user=tu.user_id
				LEFT JOIN ".$db_prefix."ratings tr ON tr.rating_item_id = tp.photo_id AND tr.rating_type='P'
				WHERE photo_user=user_id GROUP BY photo_id ORDER BY photo_order LIMIT $rowstart,".$settings['thumbs_per_page']
			);

 

Pēc visa viņam jābūt iekš WHERE, bet vai var 2 ievietot? Ja var tad kā? Pasakat lūdzu!

Edited by archux
Link to comment
Share on other sites

×
×
  • Create New...