Support » Fixing WordPress » Error when editing links “WHERE link_id”

  • Hi folks,

    Any help would be most appreciatesd.

    I am running WP1.2.2.

    I have the php+MySQL+Apache versions that come with this great bundle: They are:
    —Apache version : Apache/1.3.31 (Win32)
    —PHP version : 5.0.2
    —MySQL version : 4.0.21-nt-log

    All installed and working but when in Admin I go to Links, Manage links, & then click “Edit” on any of the links, I get:
    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 ‘WHERE link_id = 4’ at line 1]
    SELECT * FROM WHERE link_id = 4
    Link not found.

    The “4” varies on which link I choose to edit (of course).

    I have tried (really I have mom) but I couldn’t find the answer in the forum, and by searching Google, it looks as if Google has cached loads of pages with this error code but none (that I found) with the answer.

    My guess is that I am using newer-than-normal versions of Apache/php/MySQL? Or maybe I have been a clutz and left some default setting in their install that is SO bad, WP if coughing.

    I am only using this locally on localhost at the moment.

    Any help MUCH appreicated 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • Same issue,

    I think the query should be as follows;

    SELECT * FROM wp_links WHERE 1

    Im going to have a poke around and see what I can find.

    Oh my versions.

    PHP: 4.3.10
    MySQL: 4.0.22-standard
    Apache: 1.3.33 (Unix)

    I’ve had a quick poke about the wiki, I dont fully understand what’s going on but after reading this:

    I understand a little bit more.

    The error is under: case ‘linkedit’:

    $row = $wpdb->get_row(“SELECT * FROM $wpdb->links WHERE link_id = $link_id”);

    It seems that wp isnt reading $wpdb->links, an echo of $row produced:

    SELECT * FROM WHERE link_id = 14

    I hope someone knows whats going on.

    Moderator Ryan Boren


    WordPress Dev

    Redownload 1.2.2. You managed to get the broken version that existed for a short time on the download server. Replace your link-manager.php with the one from a fresh download.


    The good version of link-manager.php fixed the problem — thanks very much all concerned.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when editing links “WHERE link_id”’ is closed to new replies.