<?PHP $results = mysql_query("SELECT * FROM messages, comments WHERE messages.user_on='$user2' AND comments.msg_id_fk = messages.msg_id ORDER BY messages.msg_id, comments.com_id DESC") or die(mysql_error()); ?>
Barrett1
0
Light Poster
Recommended Answers
Jump to PostFormation of query might be wrong, could you try with your sql editor or phpmyadmin
Jump to PostThen the query returns the right output. you have to form the query according to your needs. did you executed in phpadmin sql editor? If yes, then change the query, Check properly with your records and come to know why returning one record. or Post the records in the table …
Jump to PostSELECT * FROM messages, comments WHERE messages.user_on='$user2'; SELECT * FROM messages, comments WHERE messages.user_on='$user2' AND comments.msg_id_fk = messages.msg_id; SELECT * FROM messages, comments WHERE messages.user_on='$user2' AND comments.msg_id_fk = messages.msg_id ORDER BY messages.msg_id; SELECT * FROM messages, comments WHERE messages.user_on='$user2' AND comments.msg_id_fk = messages.msg_id ORDER BY messages.msg_id, comments.com_id …
Jump to PostPlease provide your table strucutre and records to me, Let I will check
Create table...
Insert into...
Jump to PostYes, I am only going to copy and paste in my databse to create the table and records. So I need the exact code to paste, not only the structure. Just going to place in sql editor and if I click go, then it should create the table and the …
All 24 Replies
rajarajan2017
Barrett1
0
Light Poster
rajarajan2017
Barrett1
0
Light Poster
rajarajan2017
Barrett1
0
Light Poster
Barrett1
0
Light Poster
rajarajan2017
Barrett1
0
Light Poster
Barrett1
0
Light Poster
rajarajan2017
Barrett1
0
Light Poster
rajarajan2017
Barrett1
0
Light Poster
tyson.crouch
6
Junior Poster
Barrett1
0
Light Poster
Barrett1
0
Light Poster
tyson.crouch
6
Junior Poster
tyson.crouch
6
Junior Poster
Barrett1
0
Light Poster
Stylish
1
Junior Poster
Barrett1
0
Light Poster
tyson.crouch
6
Junior Poster
Stylish
1
Junior Poster
tyson.crouch
commented:
duplicated post
+0
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.