最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Querying wpdb using PHP

programmeradmin3浏览0评论

I'm a beginner trying to query a table in my wordpress database and would appreciate some pointers on where I'm going wrong... I've got a table of cricket statistics, and want to get the highest score from a column.

The code is below, and when I include $wpdb->show_errors();, I get: WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]

The data type of the Runs_1 column is int

<?php
$top_score = $wpdb->get_var (" SELECT MAX(Runs_1) FROM $wpdb->Bangalore") ;
echo "<p>Top first innings score is {$top_score} </p>";
?>

Any help would be much appreciated.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论