This is the code which gets data from database:
Quote:
|
$mtladmtavari = $wpdb->get_row("SELECT * FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = $araperi AND taxonomy = 'category' ");
|
As you see there is $araperi variable after term_taxonomy_id and it seems this variable doesn't always have any value.
Will this code prevent database query if the $araperi variable is empty?
Quote:
<?php
if ( $araperi != NULL ) {
$mtladmtavari = $wpdb->get_row("SELECT * FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = $araperi AND taxonomy = 'category' ");
} ?>
|
Have you got any better ideas?
Thanks