sql not working
-
I created a few tables in my main wordpress database…
table names:
cards
scardsI put a plugin that lets me use php in pages, I use it in my other wordpress sites, very succesfully… but in this new website I’m working on, I cannot get the SQL to work right.
Here is what I am trying to do:
[php] // This opens a PHP Tag like <?php would... global $wpdb; $_openm = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM cards" ) ); $_amtClosed = $wpdb->get_var( $wpdb->prepare( "SUM(f1) from scards" ) ); [/php] Content... content... content... then I use the variables... Open cards ([php] echo $_openm; [/php]) Closed cards total funds ([php] echo $_amtClosed; [/php]) more content...
But the variables are blank on the page output.
I have tested the php tag like this:
[php] echo "Hello newbie";[/php]
and that does output that, so it is executing the php.Can you tell me what I did wrong? I even tried to put those variables as global in case it was not remembering them after I closed the first php tag…
still nothing.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘sql not working’ is closed to new replies.