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?
7 2751
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
Thank you...
im newbie. can u tell clearly. i.e. whr did i put this???
:-(
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
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]
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.... - 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
-
-
-
SELECT cat_id, cat_name FROM
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
You may want to try setting your query to: "SELECT cat_id, cat_name FROM {$wpdb->linkcategories}"
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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#"...
|
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>"; ...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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...
| | |