Affichage des articles dont le libellé est Re: Using SQL queries in Theme template. Afficher tous les articles
Affichage des articles dont le libellé est Re: Using SQL queries in Theme template. Afficher tous les articles

Re: Using SQL queries in Theme template

mardi 25 novembre 2014

Thank you anyway. :)



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

Ah, see, this wasn't exactly clear, especially since the join actually implies it wouldn't do that (but I'm doing it off the top of my head, not looking at an actual database, and it is like 3am... so yeah, I could well be wrong)



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

You are awesome, thank you a lot.



My query finds all topics that do not belong to certain category in which a specific member has posted at least one message, in fact (not only those which he is the author of the first message, as my first request, and...



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

@Yojin_Spajin: SMF does not allow for subselects.



That said, it seems a *very* inefficient way of doing it to me, and you may want nearer to:

[code]

SELECT t.ID_TOPIC, m.subject

FROM smf_topics AS t

INNER JOIN smf_messages AS m ON (t.ID_FIRST_MSG = m.I...



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

Your using subqueries call this before your query

Code: [Select]

global $modSettings;

$modSettings['disableQueryCheck'] = true;




Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

Hi again !



I think we are almost done ! Works great with the request I've shown to you. But when I try with this request :



[code]SELECT topics_rp.subject

FROM smf_messages, (

SELECT smf_messages.ID_TOPIC, smf_messages.subject

FROM smf_messages, smf_top...



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

Arantor sure there maybe better practices but 90% people don't need it. For SMF core sure but for their own sites it doesn't matter just do what gets the job done. And honestly the mod approval process should be scrapped it is way too tough and scares ...



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

There's no db_ function for fetch_assoc in 1.1, you would use db_query to perform the query and mysql_fetch_assoc to fetch the data. This is deprecated in PHP itself in 5.5 and may be removed in future versions without notice.



Even if you use a single ...



Re: Using SQL queries in Theme template

Re: Using SQL queries in Theme template

VBGamer45 > Haha, you are welcome, thank. ;D



Arantor > Maybe there is an other cleaner way to display it only for a specific theme, but well, we are using each theme like an isolated sandbox, even in the offered features, so this much more convenient f...



Re: Using SQL queries in Theme template
 

Lorem

Ipsum

Dolor