Recordset: Probably an easy problem to fix?!

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Mon Sep 02, 2002 1:56 pm

I am having a problem with my php page. When I change the variable in the web address (TeamID) it keeps giving me the first record in the db. See code below.

When I try

I get the first team in my db which is Aberdeen when it should give me Queens, it always gives me Aberdeen? I am doing some really stupid.

Any assistance would be greatly appreciated.

Also when I echo the query I get:

SELECT * FROM fixtures WHERE fixtures.TeamName LIKE '%'

$db_handle = mysql_connect("","username","password") or die (mysql_error());
mysql_select_db("mydb",$db_handle) or die (mysql_error());

$sqlVar="SELECT * FROM fixtures ";
$sqlVar.="WHERE fixtures.TeamName LIKE

$myquery = mysql_query($sqlVar,$db_handle) or die (mysql_error());
$rs = mysql_fetch_array($myquery)


<TABLE width="600" border="0" cellpadding="0" cellspacing="0">
<TD width="600" height="35" valign="middle" align="center" class="maincolor">
<P class="title"><?=$rs["TeamName"]; ?> Fixtures 2002/03</P>
echo $sqlVar


Tue Sep 03, 2002 2:16 pm

Neobis wrote:when I echo the query I get:

SELECT * FROM fixtures WHERE fixtures.TeamName LIKE '%'

That should indicate to you that there is a flaw in your PHP coding! But it's not something that I can see though! I presume your server settings are correct, otherwise you wouldn't be using $_GET['TeamID'].

Try working out why you can't get the $_GET['TeamID'] value to appear correctly, then correct the fault. It should work then!

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests