Quote:
Originally Posted by Xenon
try that one:
PHP Code:
<?php require_once('./global.php'); $smilie_counts = array(); $posts = $DB_site->query(" SELECT smilietext, pagetext FROM post, smilie WHERE pagetext like concat('%', smilie.smilietext, '%') "); while ($post = $DB_site->fetch_array($posts)) { $smilie_counts["$post[smilietext]"] += substr_count($post['pagetext'], $post['smilietext']); } $output = ''; foreach ($smilie_counts AS $name => $val) { $output .= $name . ' -> ' . $val . '<br />'; } print_output($output); ?>
|
Tahnk you, sir. That seems to be a lot faster than the other query.
The only strange thing is that in your query:

-> 218
and in the first query:

-> 228
That was the only one that was lower with your query.
Also, how would we order the listing from the highest count to the lowest?