Jump to content
php.lv forumi

SQLiņš


sandis_m

Recommended Posts

Man te tāds sasāpējies jautajums sakarā ar SQL pieprasījumu

 

Šis te man parāda manus draugus (baigi forši)

$object->query = "SELECT u.uid,name,lastname,lastactive,profilepic_100,b_year,b_month,b_day,underinfo,privilegie,showage,  f.`friendid`,`myid`,`group`
FROM `all_classmates` u, `all_classmates_friends` f	
WHERE f.myid='$_SESSION[user_id]' 
AND f.friendid=u.uid
AND f.`group` != 1
GROUP BY f.friendid
ORDER BY f.friendid DESC, f.friendid DESC";

 

 

Bet es gribu, lai uz bildes mētātos visādas stulbas dāvanas ( nu tādas kā draugiem.lv ;D )

 

Ir tabula `gifts` ar lauciņiem

gifid(primary)

type

sendfrom

sendto

text

know

paid

 

 

Un tabula `gifts_files` ar lauciņiem

id(primary)

title

file

price

 

Un vajadzētu kaut kā WHERE sendto='usera_id' AND type=gifts_files.file

 

ar tiem JOINiem atkal? Man nesanāk. Googlē meklēju kkādu normālu lasāmvielu par tiem JOINiem, bet

neviena sakarīga piemēra neatradu.

 

 

Nē, nu es jau varētu lietot deadly pieprasījumu iekš pieprasījuma, bēēēt....MySQLiņš sāks nedraudzēties.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...