Help with code needed

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
Scorpion
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Oct 21, 2002 3:02 pm
Location: England
Contact:

Help with code needed

Postby Scorpion » Mon Nov 18, 2002 12:11 pm

Help needed please.....
I have the code below which displays a list of names within a marquee. What i'd like to do is make each name that appears a hyperlink to a page. The hyperlink code if not used in the marquee is:
<a href=MemberInfo.php?IDNo=$IDNo></a>
but i cant work out how to make this work inside the code below.


<MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 scrollDelay=80 direction=up width=200 height=70>
<FONT face="comic sans ms" size=2><B><p align="center">SFE Members List:<BR></B>
<?php
$db = mysql_connect("*********","**********","********");
mysql_select_db("deltaforceone",$db);
$result = mysql_query("SELECT * FROM DF1 order by IDNo",$db);
while ($myrow = mysql_fetch_array($result)) {
echo $myrow ["Handle"]."<BR>
";
}
?>
</FONT></marquee>

I would be very grateful if anyone could assist me with this, thanks

Tony

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Mon Nov 18, 2002 7:55 pm

our code

Code: Select all

<MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 scrollDelay=80 direction=up width=200 height=70>
<FONT face="comic sans ms" size=2><B><p align="center">SFE Members List:<BR></B>
<?php
$db = mysql_connect("*********","**********","********");
mysql_select_db("deltaforceone",$db);
$result = mysql_query("SELECT * FROM DF1 order by IDNo",$db);
while ($myrow = mysql_fetch_array($result)) {
echo $myrow ["Handle"]."<BR> ";
}
?>
</FONT></marquee>


My code

Code: Select all

<FONT face='comic sans ms' size=2><B><p align=center>SFE Members List:<BR></B>
<?php

$db = mysql_connect("*********","**********","********");
mysql_select_db("deltaforceone",$db);
$result = mysql_query("SELECT * FROM DF1 order by IDNo",$db);
while ($myrow = mysql_fetch_array($result)) {
echo "<MARQUEE onmouseover=this.stop() onmouseout=this.start() scrollAmount=1 scrollDelay=80 direction=up width=200 height=70> ";

echo "<a href=$myrow['Url']>$myrow ['Handle']</a></marquee> <BR> ";

}
?>
</FONT>

User avatar
Scorpion
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Oct 21, 2002 3:02 pm
Location: England
Contact:

Help with code needed

Postby Scorpion » Tue Nov 19, 2002 3:22 pm

Ok, thanks for replying, but...

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/deltaforceone/www/ESF/SFETop.php on line 27

line 27 looks like,

echo "<a href=$myrow["MemberInfo.php?IDNo=$IDNo"]>$myrow ["Handle"]</a></marquee> <BR> ";

I dont know if its possible to do what i want, the list is displayed in a marquee, the list is taken from a db called DF1, each name has a IDNo which is in same db but seperate field. As the names scroll, the hyperlink that needs to be created is to Memberinfo.php containing the IDNo of the persons name so that memberinfo.php can display the correct information.

Does any of that make sense, lol coz i'm slowly confusing myself.

Any further help gratefully received....

Tony.

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Nov 20, 2002 2:42 am

my mistake


$query=mysql_query("SELECT * FROM `yourtable` WHERE `IDNo` = '$IDNo'");
$myrow=mysql_fetch_array($query);


Code: Select all

echo "<a href=MemberInfo.php?IDNo=$myrow[IDNo]>$myrow [Handle]</a></marquee> <BR> ";


Return to “PHP coding => General”

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests