What's new

Help Messenger Style Private Messaging

reacah

Eternal Poster
Established
Joined
Oct 9, 2015
Posts
1,095
Reaction
167
Points
362
Age
34
Etu po sql syntax ko:

$sql = "SELECT id, sender, timesent FROM messages WHERE receiver='". $mycookie."' AND spam='0' AND archive='0' GROUP BY sender ORDER BY timesent DESC LIMIT 0, 10";

un gusto ko po sana maging layout nyan style ng messeneger. ang problem kapag new message from me to other user di lumalabas unless other user going to me un lalabas sya. unlike sa messenger kapag ikaw sender or may bagong pm lalabas dun parehas . pa correct po if ever mali syntax ko.

nagawa ko na sya dati di ko na maalala kung paano ko nagawa. patulong po sana.


additional lang: anu pwede pamalit sa mail(); since di pa ako nag install ng smtp server
 
Last edited:
d po talaga lalabas sir kasi naka filter as receiver only, kapag first time message mo meaning wala ka pang na receive na message ergo your not a receiver, kilangan mo ng message sent filter.
 
d po talaga lalabas sir kasi naka filter as receiver only, kapag first time message mo meaning wala ka pang na receive na message ergo your not a receiver, kilangan mo ng message sent filter.
Dagdagan mo sa criteria para sa sender.


pahinge po konting idea salamat kahit sa syntax lang kahit mag add ng fields sa sql table ko po thanks
 
Baka kailangan mong ilapag ang design ng table mo at sample data ng para sa sender
 
Baka kailangan mong ilapag ang design ng table mo at sample data ng para sa sender
table name: private_pms
column names:
id
sender
receiver
text
timesent
spam
archive
viewed
attachmentid

tatlo na un ginawa ko na syntax kaso di ko pa rin makuha talaga un messenger style eh

1ST SYNTAX
$old_sql1 = "SELECT id, sender, viewed, text, timesent FROM private_pms WHERE receiver='".$uid."' AND sender='".$uid."' AND archive='0' AND spam='0' GROUP BY sender, receiver ORDER BY timesent DESC LIMIT $limit_start, $items_per_page";


2ND SYNTAX

$old_sql2 = "SELECT
a.name, b.id, b.sender, b.unread, b.archive, b.timesent, b.receiver FROM users a
INNER JOIN private_pms b ON a.id = b.sender
WHERE b.receiver='".$uid."' AND b.archive='0' AND b.spam='0' GROUP BY a.id
ORDER BY b.timesent, b.sender DESC
LIMIT $limit_start, $items_per_page
";

3RD SYNTAX
halos same lang ginawa ko sa 1st syntax iba lang sa GROUP BY


pa help sana po


NOTE LANG: live database at actual code ang inaapply ko pero ako lang may access sa page na yan hehe
 
Last edited:
iho ang mali mo is hindi kinonsider na p2p dapat ang message. base sa query mo ilalabas niya lang talaga is outgoing
 

Similar threads

Back
Top