FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Like and % Function Problem..





fizzo
Code:
<html>
<head>
<title>NLL Ballers - Player Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>

  <?php
  require('cddooeend.php');
  $Team = $_GET['TEAMID'];
$team = mysql_query("SELECT LASTNAME FROM Players WHERE LASTNAME like 'A%' ORDER By LASTNAME");
 echo"<tr>
<th style=border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium bgcolor=black><font size=1 face=Verdana color=black></th>
<th style=border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium bgcolor=black><font size=3 face=Verdana color=black>A</th>
</tr></font><br>";
 while($row = mysql_fetch_array($team))
{
  echo "<tr>";
  echo "<td>"."<b>"."<a href=http://nllballers.net/profiles/player1.php?PLAYERID=".$row['PLAYERID'].">".$row['FIRSTNAME'] . " " . $row['LASTNAME']."</b>"."</a>"."</td>";
  echo "<td>"." " . $row['TEAM'] . "</td>";
  echo "<br>";
}
echo "</table>";

?>
 <?php
 require('cddooeend.php');
 $Team = $_GET['TEAMID'];
$team = mysql_query("SELECT LASTNAME FROM Players WHERE LASTNAME like 'B%' ORDER By LASTNAME");
 echo"<tr>
<th style=border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium bgcolor=black><font size=1 face=Verdana color=black></th>
<th style=border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium bgcolor=black><font size=3 face=Verdana color=black>B</th>
</tr></font><br>";
 while($row = mysql_fetch_array($team))
{
  echo "<tr>";
  echo "<td>"."<b>"."<a href=http://nllballers.net/profiles/player1.php?PLAYERID=".$row['PLAYERID'].">".$row['FIRSTNAME'] . " " . $row['LASTNAME']."</b>"."</a>"."</td>";
  echo "<td>"." " . $row['TEAM'] . "</td>";
  echo "<br>";
}
echo "</table>";
?>


I have some problems with this codes.. It doesnt shows the Firstname and the Team of the player it just shows the Lastname Are there any problems with my codes help guys thanks!

to see the page online here it is..

http://nllballers.net/profiles/player_index1.php


hoping to hear it from you..
Star Wars Fanatic
You're MySQL query isn't done right:

Code:
SELECT LASTNAME FROM Players WHERE LASTNAME like 'A%' ORDER By LASTNAME


That will only get the LASTNAME. To get the FIRSTNAME and TEAMNAME, you need to do something like this:

Code:
SELECT LASTNAME, FIRSTNAME, TEAMNAME FROM Players...


When using the SELECT, you have to specify which columns you want returned.

You should be able to construct the query properly now, if you can't look into the SELECT command a little bit, so you understand what you are doing wrong, it's helpful to learn this stuff for the future.
fizzo
thanks its very helpful..
Related topics
Header("Location: PROBLEM");
ASP Problem
SMTP problem
[HELP] PC PROBLEM (don't bind)
terrorism in israel
PHP Problem: Unable to execute ext. commands
A minor printing problem
javascript function not being seen
Password problem
(server 2) php function exif_read_data() not supported ?
problem with registration notify mod
ScanDir function problem
Redeclared function problem
Including file with same definition on Win & Linux
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.