I'd like to create a new view in my database but I can't seem to do it actively, through a php function. I can't find any info on doing this, though there's plenty on making tables. The only support thread I saw on it was a year old and had no responses.
I've tried using the table creation functionality ($sql = "blahblah", require_once the upgrade.php file and dbDelta($sql)), but that doesn't achieve anything.
I even tried running the view creation SQL as a query using get_results($sql) but that didn't work.
Is it possible to create a view via a function and, if so, how does one go about it? I can do it through phpMyAdmin if I have to, but I'd really rather do it dynamically so that it handles itself as part of my custom theme.
Thanks in advance.