SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru
    Join Date
    Dec 2005
    Posts
    964
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't figure this out...

    I'm trying to make a "favorites" script, but are having some problems...

    I want the user to be able to make a link with the following data into my db table (links):

    linkid, name, url

    I then want another table where the references from the user to the link should be like this table (link_ref):

    userid, linkid

    My trouble comes when I want to print this depending on the user... This is what I have tryid:

    PHP Code:
    <?
    $f 
    $prefix.'_links';
    $r $prefix.'_link_ref';

    $sql $db->sql_query("SELECT ".$f.".linkid, ".$f.".name, ".$f.".url FROM ".$f." INNER JOIN ".$r." ON ".$f.".linkid = ".$r.".linkid WHERE ".$r.".uid = $userid");
    while (
    $row $db->sql_fetchrow($sql)) {

    echo 
    '<a href="'.(strstr($row['url'], 'http') == false 'http://' '').$row['url'].'">'.$row['name'].'</a><br>'

    }
    ?>
    The only trouble is that nothing seems to come out... Where do I go wrong?!?

  2. #2
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Are you sure your server currently supports PHP short tags?
    2. Did you try adding the following to make sure that errors are being displayed if there are any?
    PHP Code:
    ini_set('display_errors'1);
    error_reporting(E_ALL); 
    Creativity knows no other restraint than the
    confines of a small mind.
    - Me
    Geekly Humor
    Oh baby! Check out the design patterns on that framework!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •