Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

August 12, 2022, 03:24:26 AM

Login with username, password and session length
Members
  • Total Members: 3842
  • Latest: Kokoro
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 50
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 0
Guests: 45
Total: 45

Author Topic: Today In History Question  (Read 10688 times)

0 Members and 1 Guest are viewing this topic.

Mitch

  • Guest
Today In History Question
« on: March 15, 2006, 01:49:55 PM »
What my original code is:

Code: [Select]
$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:

Code: [Select]
$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:

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

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Today In History Question
« Reply #1 on: March 15, 2006, 03:12:54 PM »
This line:
Code: [Select]
echo '</marquee>;
Needs to have this:
Code: [Select]
echo '</marquee>';

TwinsX2Dad

  • Guest
Re: Today In History Question
« Reply #2 on: March 15, 2006, 03:16:16 PM »
Lose one apostrophe and your echo gets lopsided.

Nobody wants a lopsided echo.

Mitch

  • Guest
Re: Today In History Question
« Reply #3 on: March 15, 2006, 06:55:27 PM »
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

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Today In History Question
« Reply #4 on: March 15, 2006, 11:09:29 PM »
Also this line:
Code: [Select]
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'">;

Needs to be this:  (I think)
Code: [Select]
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover='this.stop()'onmouseout='this.start()'>';

feline

  • Guest
Re: Today In History Question
« Reply #5 on: March 16, 2006, 02:32:13 AM »
the correct line:
Code: [Select]
echo '<marquee bgcolor="transparent" scrollamount="2" direction="up" loop="true" width="100%" onmouseover=\'this.stop()\' onmouseout=\'this.start()\'>';

Fel

crip

  • Guest
Re: Today In History Question
« Reply #6 on: March 16, 2006, 03:13:40 AM »
If micth hasn't run the sql .zip via myphpadmin it will never work....

Mitch

  • Guest
Re: Today In History Question
« Reply #7 on: March 16, 2006, 05:36:25 AM »
Hmm I can try to do this.

But just so everyone knows it was working before I decided to make it scroll.

Mitch

  • Guest
Re: Today In History Question
« Reply #8 on: March 16, 2006, 06:19:30 AM »
Ok well I got this to work. But then I just deleted it because it made the block headers "bounce".

Offline IchBin

  • Friends
  • *
  • Posts: 16231
Re: Today In History Question
« Reply #9 on: March 16, 2006, 07:14:16 AM »
the correct line:
Code: [Select]
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