WordPress.org

Ready to get started?Download WordPress

Forums

get_linksbyname (3 posts)

  1. pvicnan
    Member
    Posted 10 years ago #

    I was browsing through the wiki, and decided to experiment. I inserted this tag <?php get_linksbyname(); ?> and it worked perfectly. However, once I tired to enter in any peremeters, it mucked up. I even tried <?php get_linksbyname('','','','','','','','','',''); ?> which should have worked, yes? I instead, as with the other tries, recived this: 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 4]
    SELECT link_url, link_name, link_image, link_target, link_description, link_rating, link_rel , IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated FROM wp_links WHERE link_visible = 'Y' ORDER BY link_id ASC LIMIT

    Any ideas why?
    Thanks! ^.^

  2. Zarniwoop
    Member
    Posted 10 years ago #

    You will have to feed it some useful parameters. Not all parameters are strings, some are numbers and they are all explained in the wiki documentation. In your example you have set LIMIT to '' which is an error because it has to be a number. Looks like WP doesn't check for valid parameter types but this may be a performance consideration. The best way is to start with the default values also described in the wiki docs and modify them until they fit your needs.

  3. pvicnan
    Member
    Posted 10 years ago #

    ah.. thank you! ^.^

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.