What my original code is:
$my_height = 15;
$today = mktime();
$today_day = date("j", $today);
$today_month = date("n", $today);
$request = db_query("SELECT pn_yid, pn_content FROM nuke_ephem WHERE pn_did=$today_day AND pn_mid=$today_month ORDER BY pn_yid ASC", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
echo '<div style="height: '.$my_height.'ex; overflow: auto;">';
while($row = mysql_fetch_assoc($request)){
echo '<b>' . $row['pn_yid'] . '</b> - ' . $row['pn_content'] . '<br />';
}
echo '</div>';
mysql_free_result($request);
}I would like it to scroll and then stop with mouse hovers over it I thought that code would be this:
$my_height = 15;
$today = mktime();
$today_day = date("j", $today);
$today_month = date("n", $today);
$request = db_query("SELECT pn_yid, pn_content FROM nuke_ephem WHERE pn_did=$today_day AND pn_mid=$today_month ORDER BY pn_yid ASC", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
{
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'">;
echo '<div style="height: '.$my_height.'ex; overflow: auto;">';
while($row = mysql_fetch_assoc($request)){
echo '<b>' . $row['pn_yid'] . '</b> - ' . $row['pn_content'] . '<br />';
}
echo '</div>';
echo '</marquee>;
mysql_free_result($request);
}But its not. I get this error when I try to do it:
QuoteParse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/gamesnet/public_html/forums/Sources/Load.php(1613) : eval()'d code(34) : eval()'d code on line 10
This line:
echo '</marquee>;
Needs to have this:
echo '</marquee>';
Lose one apostrophe and your echo gets lopsided.
Nobody wants a lopsided echo.
Did what you told me to now I have a
Quote
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/gamesnet/public_html/forums/Sources/Load.php(1613) : eval()'d code(34) : eval()'d code on line 10
Also this line:
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'">;
Needs to be this: (I think)
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'>';
the correct line:
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';
Fel
If micth hasn't run the sql .zip via myphpadmin it will never work....
Hmm I can try to do this.
But just so everyone knows it was working before I decided to make it scroll.
Ok well I got this to work. But then I just deleted it because it made the block headers "bounce".
Quote from: feline on March 16, 2006, 09:32:13 AM
the correct line:
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';
Thank you Fel, I haven't quite learned what needs to be escaped and why. In that example I finally understood it. :)
Fel
Oh and yes thank you Fel!!!!!
Hix, It scroll all of one: theÃ, scroll bar and the content of blockÃ, :o
Then I have made correct it by this code
$my_height = auto;
$today = mktime();
$today_day = date("j", $today);
$today_month = date("n", $today);
$request = db_query("SELECT pn_yid, pn_content FROM nuke_ephem WHERE pn_did=$today_day AND pn_mid=$today_month ORDER BY pn_yid ASC", __FILE__, __LINE__);
if (mysql_num_rows($request) > 0)
Ã, {echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';
Ã, Ã, Ã,Â
Ã, Ã, Ã, Ã, echo '<div style="height: '.$my_height.'ex; overflow: auto;">';
while($row = mysql_fetch_assoc($request)){
echo '<b>' . $row['pn_yid'] . '</b> - ' . $row['pn_content'] . '<br />';
}
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, echo '</div>';
Ã, Ã, Ã, Ã, echo '</marquee>';Ã, Ã, Ã, Ã, Ã,Â
mysql_free_result($request);
Ã, }
It has fixedÃ, and work fine :laugh: