473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

ERROR: SELECT cat_id, cat_name FROM in Wordpress Bolg

deephill
hi
I am getting SELECT cat_id, cat_name FROM Error in Wordpress Blog. Im getting below error in my online site. Wht can i do?

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]
SELECT cat_id, cat_name FROM
Sample template i am viewing Blogrolls. But in online site i cant. The code is...

[PHP]<?php
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
foreach ($link_cats as $link_cat) {
?>
<div class="widget_style" id="links_with_style">
<div class="cats_head">
<h2 class="h3">cat_name; ?>
</div>
<ul>
<?php get_links($link_cat->cat_id, '', '', '
', FALSE, 'rand', TRUE,
TRUE, -1, TRUE); ?>
</ul>
</div>
<?php } ?> [/PHP]


Anybody help me?
May 2 '07 #1
7 2751
devsusen
136 100+
Hi,

[PHP]$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");[/PHP]

I think you r not getting the file name using $wpdb->linkcategories

try to print out the query using

[PHP]echo "SELECT cat_id, cat_name FROM $wpdb->linkcategories"[/PHP]

susen
May 2 '07 #2
Thank you...

im newbie. can u tell clearly. i.e. whr did i put this???
:-(
May 2 '07 #3
devsusen
136 100+
put the 2nd line of just above the 1st line of code. Now see if u r getting the sql query printed properly or not.

susen
May 4 '07 #4
hi.. i put like this. but its same error. wht should i do?

[PHP]<?php
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
echo "SELECT cat_id, cat_name FROM $wpdb->linkcategories";
foreach ($link_cats as $link_cat) {
?>
<div class="widget_style" id="links_with_style">
<div class="cats_head">
<h2 class="h3">cat_name; ?>
</div>
<ul>
<?php get_links($link_cat->cat_id, '', '', '
', FALSE, 'rand', TRUE,
TRUE, -1, TRUE); ?>
</ul>
</div>
<?php } ?> [/PHP]
May 7 '07 #5
hi i put like this.
[PHP]<?php
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
echo "SELECT cat_id, cat_name FROM $wpdb->linkcategories";
foreach ($link_cats as $link_cat) {
?>
<div class="widget_style" id="links_with_style">
<div class="cats_head">
<h2 class="h3">cat_name; ?>
</div>
<ul>
<?php get_links($link_cat->cat_id, '', '', '
', FALSE, 'rand', TRUE,
TRUE, -1, TRUE); ?>
</ul>
</div>
<?php } ?> [/PHP]

now i am getting below message in the sidebar.php....



Expand|Select|Wrap|Line Numbers
  1. 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]
  2.             SELECT cat_id, cat_name FROM 
  3.  
  4.  
  5. SELECT cat_id, cat_name FROM
May 7 '07 #6
devsusen
136 100+
HI,

so what I told u earlier that u r not getting value of $wpdb->linkcategories.

So first search if u have a table named wp_linkcategories in ur database or not. Now if the table is there then search wp-config.php or wp-settings.php files for the variable.

IMHO u should go for updating wordpress application for blog.

susen
May 8 '07 #7
Motoma
3,237 Expert 2GB
You may want to try setting your query to: "SELECT cat_id, cat_name FROM {$wpdb->linkcategories}"
May 9 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Trevor Sather | last post by:
------=_NextPart_000_004D_01C3456C.66EFEC50 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello The following query used to work when I was using an Access...
3
by: Jaunty Edward | last post by:
Hi, I am confused with this query I have to write a query that will select data from many tables having a username field where username is given. I used something like, select * from...
1
by: new2php | last post by:
Hi,I'm new to PHP...I currently doing a PHP project....I don't understand this code..can someone please kindly explain to me..Thanks select * from category c left join category2 c2 on...
0
deephill
by: deephill | last post by:
hi I am getting SELECT cat_id, cat_name FROM Error in Wordpress Blog. Im getting below error in my online site. Wht can i do? Sample template i am viewing Blogrolls. But in online site i...
9
nomad
by: nomad | last post by:
When I run this program I get an error. The error appears after I select the second link. I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL...
7
by: ashraf02 | last post by:
i have check the code thoroughly to find the error i am still getting the following error: Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\Catalogue.php on line 23 <!DOCTYPE html...
6
by: ashraf02 | last post by:
can some one please help me i am getting this error but i cant seem to figure out wat is wrong on line 3 everything looks fine <?php $conn = mysql_connect("localhost","root","") or die...
1
by: ashraf02 | last post by:
I am getting this error when i run the php file and cant figure out why. everything seems to look fine. the error i get is: here is my php code. <?php $conn = mysql_connect...
1
by: mimranp | last post by:
Hi all i m using visual developer 2008 i m using xhtml1.1 in that .i m reciving so much error when check in online input w3 standard(C# language code behind) <%@ Page Language="C#"...
2
ddtpmyra
by: ddtpmyra | last post by:
How can I assgined value to each row of my query result? Example Book=1; Fruits=2; Animals=3 OR is there other way to do it? thanks for your help! echo "<tr><td><b>Categories:</b></td>"; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.