I created a simple update command to update a database entry. I want to be able to run any sql statement and update my wordpress database:
<?php
global $wpdb;
$sql = "UPDATE tablename SET column1='testdata' WHERE id=1";
$results = get_results($sql); ?>
or
$results = query($sql);
No matter what I do I get the error:
Fatal error: Call to a member function get_results() on null in C:\MAMP\htdocs\new\samplesql.php on line 4