Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question PHP + mySQL Syntax error "Trying to link info from DB using PHP" getting Parse error.

    I get a Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in D:\xampp1\htdocs\header.php on line 181

    line 181 is line 6 on pastebin;
    http://pastebin.com/d1eeabdb0

    PHP Code:
        <?php
        mysql_select_db
    ($db_name);
        
    $linkovi  mysql_query("SELECT title,link,tooltip FROM pages WHERE position = '1' ORDER BY orderby ASC") or die (mysql_error());
        while (
    $linkovi2=mysql_fetch_assoc($linkovi))
        {
            print 
    '<a href="'.$linkovi2['link'].'" title="" onmouseover="$WowheadPower.showTooltip(event, '.$linkovi2['tooltip'].')" onmousemove="$WowheadPower.moveTooltip(event)" onmouseout="$WowheadPower.hideTooltip();">'.$linkovi2['title'].'</a>';
        }
        
    ?>
    // example tooltip link for regular html
    <a href="./quest.php?name=shoutbox" onmouseover="$WowheadPower.showTooltip(event, 'Chat with other b3ckswow users Live!')" onmousemove="$WowheadPower.moveTooltip(event)" onmouseout="$WowheadPower.hideTooltip();">Shoutbox</a>

    I can tell you the way I have been using to pull info from the DB using PHP is
    '.$linkovi2['tooltip'].'
    but
    onmouseover="$WowheadPower.showTooltip(event, 'Chat with other b3ckswow users Live!')"
    the event uses '' already to enclapse the tooltip info, I am pretty lost right about now, any help would be greatly appriciated.

    thanks in advance,
    -b3ck
    Last edited by b3ck; 04-11-2009 at 06:05 PM.


 

Tags for this Thread

Posting Permissions

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