I am trying to update a table in WordPress that I created myself through a plug-in that I created. However I keep getting this error:
The website encountered an error while retrieving /add-van-process.php.
It may be down for maintenance or configured incorrectly.
Error code: 500
This is the PHP that I am using:
<?php
global $wpdb;
$data = array("model"=>"Ford")
$wpdb->insert("van_table", $data);
?>
The file name and table name are correct and exist. Anyone got any ideas how to fix this?
much appreciated
edit: I am using WordPress Version Version 3.5.2 if that is needed.
edit: after changing this code to:
$wpdb->get_row("SELECT * FROM van_table");
I get this error: PHP Fatal error: Call to a member function get_results() on a non-object
Any clues?
You're missing a semi-colon on this row:
$data = array("model"=>"Ford")
Also, you might want to enable WP_DEBUG - this way you'll see the actual error and not a standard Error 500 message: http://codex.wordpress.org/WP_DEBUG
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments