wpdb update gives 500 error
-
I’ve been trying to make a small plugin for an image rotator on a wordpress blog. I’ve got some variables saved in a seperate table on my database next to wordpress. However, I’ve been trying to update these variables using the wpdb class and I keep getting a 500 error (An unexpected condition found when the server would execute the request).
This is the piece of code it keeps breaking on:
if ($_GET[‘photo’] != null)
{
$row_number = intParse($_GET[‘photo’]);global $wpdb;
$table_name = ‘simple_image_rotator’;
$col_name = ‘description’;
$post_text = $_POST[‘posttext’];$wpdb->update(
$wpdb->$table_name,
array( $col_name => $post_text ),
array( ‘number’ => $row_number )
);
}Basically, I give a number 1-7 in a querystring. I use that identify which record needs to be updated. I’ve tested $row_number and $post_text, they both contain a correct value. This piece of code is located on a seperate php file that is called trough a html form.
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
-
Hello there,
You are posting to the wrong support forum. We cannot help your here at WordPress.COM as your software is different. The support bot is pointing your to the correct forum for your software at http://wordpress.ORG/support/ -
-
- The topic ‘wpdb update gives 500 error’ is closed to new replies.