SELECT
w.ID, w.unixtime, w.title, w.text, w.hashtagsID,
u.name_surname,
c.ID, c.authorcomm_uid, c.text
FROM walls w
LEFT JOIN users u ON w.author_uid = u.ID
LEFT JOIN comments c ON w.ID = c.wall_id
WHERE c.wall_id = 4
ORDER BY c.ID LIMIT 10
SELECT DISTINCT
w.ID, w.unixtime, w.title, w.text, w.hashtagsID,
u.name_surname,
(SELECT COUNT(*) FROM comments WHERE comments.wall_id = w.ID) AS CountComment
FROM walls w
LEFT JOIN users u ON w.author_uid = u.ID
LEFT JOIN comments c ON w.ID = c.wall_id
ORDER BY w.ID DESC LIMIT 10
curl_formadd(&post,
&last,
CURLFORM_COPYNAME, "photo",
CURLFORM_FILECONTENT, file.c_str(),
CURLFORM_END);
curl_formadd(&formpost,
&lastptr,
CURLFORM_COPYNAME, "photo",
CURLFORM_FILENAME, filename.c_str(),//"screenshot 2015-03-09 001_en.png",
CURLFORM_FILE, fileurl_indisc.c_str(),//"D:\\screenshot 2015-03-09 001_en.png",
CURLFORM_CONTENTTYPE, "multipart/form-data",
CURLFORM_END);