Jump to content

Problem with table


Smee

Recommended Posts

Hi,

 

I have a working table that produces the info that i require however after adding it to the page what ever i try and add after it seems to make the PHP result vanish aswell as not showing the div i had tried adding.

 

I have got a feeling it is something to do with the PHP i added and not set up properly because when this table is removed i can add divs and information like normal.

 

Any help would be much appreciated.

 

Thanks

 

<?php

$error = null;

if(isset($_POST['submit'])){ // Search form

// Do the search query here first:

require_once ('../mysql_connect.php');

// Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.)

if (

mysql_real_escape_string( $_POST['team_name'])

) {

// Select every column from the table where conditions match:

$query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] .  "%'";

$result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error());

$_SESSION['indexsearch_result'] = array();

while($row = mysql_fetch_array($result)){
$_SESSION['indexsearch_result'] = $row;
}

} else {

// Save error as string, so we can use it how we wish later.

$error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>';
}
}

if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors
echo(($error != null)? $error : "");

}else{

echo('

<table width="600" height="100" border="0" />
<thead>    
  <tr>
<th scope="col">Team Name</th>
<th scope="col">Fixture List URL</th> 
  </tr>
</thead>');

echo('

<tbody>
<tr>
<td>'.$_SESSION['indexsearch_result']['team_name'].'</td>
<td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'>Fixtures</a></td>
</tr>
</tbody>
</table>'); 

// End echoing result.

}

?>

 

 

Link to comment
Share on other sites

Does this print out "Hello there!"?

 

<?php

$error = null;

if(isset($_POST['submit'])){ // Search form

// Do the search query here first:

require_once ('../mysql_connect.php');

// Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.)

if (

mysql_real_escape_string( $_POST['team_name'])

) {

// Select every column from the table where conditions match:

$query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] .  "%'";

$result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error());

$_SESSION['indexsearch_result'] = array();

while($row = mysql_fetch_array($result)){
$_SESSION['indexsearch_result'] = $row;
}

} else {

// Save error as string, so we can use it how we wish later.

$error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>';
}
}

if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors
echo(($error != null)? $error : "");

}else{

echo('

<table width="600" height="100" border="0" />
<thead>    
  <tr>
<th scope="col">Team Name</th>
<th scope="col">Fixture List URL</th> 
  </tr>
</thead>');

echo('

<tbody>
<tr>
<td>'.$_SESSION['indexsearch_result']['team_name'].'</td>
<td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'>Fixtures</a></td>
</tr>
</tbody>
</table>'); 

// End echoing result.

}
echo 'Hello there!';
?>

Link to comment
Share on other sites

replace the echo I added with

var_dump(get_defined_vars());

 

Then read the source of the page that is sent to your browser, reading all the defined variables. Find the ones that are not as you expected. If you can't figure out the error yourself, post the html source of the page here.

Link to comment
Share on other sites

Ok i added that at the bottom and have been returned 9 pages of HTML with no spaces so its kind of hard to read or understand. It seems to be giving a response for all the information stored in MySQL database.

 

None of my other pages are doing this so i have no idea why this is acting the way it is.

Link to comment
Share on other sites

Oh sure,

 

sorry its late and im not with it.

 

It has shown the same errors and its still very long so i wouldn't know where to start looking.

 

Anyway i have added it here for you to see. (just a small portion because apparently max characters is 40000)

 

<td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/a/accrington_stanley/fixtures/default.stm>Fixtures</a></td>
</tr>
</tbody>
</table>array(24) {
  ["GLOBALS"]=>
  &array(24) {
    ["GLOBALS"]=>
    &array(24) {
      ["GLOBALS"]=>
      *RECURSION*
      ["_ENV"]=>
      array(32) {
        ["CONTENT_LENGTH"]=>
        string(2) "42"
        ["CONTENT_TYPE"]=>
        string(33) "application/x-www-form-urlencoded"
        ["DOCUMENT_ROOT"]=>
        string(26) "/home/footba33/public_html"
        ["GATEWAY_INTERFACE"]=>
        string(7) "CGI/1.1"
        ["HTTP_ACCEPT"]=>
        string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
        ["HTTP_ACCEPT_CHARSET"]=>
        string(30) "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
        ["HTTP_ACCEPT_ENCODING"]=>
        string(12) "gzip,deflate"
        ["HTTP_ACCEPT_LANGUAGE"]=>
        string(14) "en-gb,en;q=0.5"
        ["HTTP_CACHE_CONTROL"]=>
        string(9) "max-age=0"
        ["HTTP_CONNECTION"]=>
        string(10) "keep-alive"
        ["HTTP_COOKIE"]=>
        string(233) "phpbb3_nfhiu_u=1; phpbb3_nfhiu_k=; phpbb3_nfhiu_sid=dc050c7e193dc87bb89825ee898f9781; style_cookie=null; phpbb3_7rsoy_k=; phpbb3_7rsoy_u=2; phpbb3_7rsoy_sid=2fe48d284c54fe446ebe9c196824625c; PHPSESSID=8e49aa1d1cbc3bb131689acd465d7a3f"
        ["HTTP_HOST"]=>
        string(20) "www.footballtrip.net"
        ["HTTP_KEEP_ALIVE"]=>
        string(3) "115"
        ["HTTP_REFERER"]=>
        string(40) "http://www.footballtrip.net/fixtures.php"
        ["HTTP_USER_AGENT"]=>
        string(88) "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
        ["PATH"]=>
        string(13) "/bin:/usr/bin"
        ["QUERY_STRING"]=>
        string(0) ""
        ["REDIRECT_STATUS"]=>
        string(3) "200"
        ["REMOTE_ADDR"]=>
        string(14) "90.212.231.148"
        ["REMOTE_PORT"]=>
        string(5) "52045"
        ["REQUEST_METHOD"]=>
        string(4) "POST"
        ["REQUEST_URI"]=>
        string(13) "/fixtures.php"
        ["SCRIPT_FILENAME"]=>
        string(39) "/home/footba33/public_html/fixtures.php"
        ["SCRIPT_NAME"]=>
        string(13) "/fixtures.php"
        ["SERVER_ADDR"]=>
        string(12) "69.175.67.90"
        ["SERVER_ADMIN"]=>
        string(26) "webmaster@footballtrip.net"
        ["SERVER_NAME"]=>
        string(20) "www.footballtrip.net"
        ["SERVER_PORT"]=>
        string(2) "80"
        ["SERVER_PROTOCOL"]=>
        string( "HTTP/1.1"
        ["SERVER_SIGNATURE"]=>
        string(0) ""
        ["SERVER_SOFTWARE"]=>
        string(6) "Apache"
        ["UNIQUE_ID"]=>
        string(24) "TA2o2UWvQ1oAACsUeKkAAAAH"
      }
      ["HTTP_ENV_VARS"]=>
      array(32) {
        ["CONTENT_LENGTH"]=>
        string(2) "42"
        ["CONTENT_TYPE"]=>
        string(33) "application/x-www-form-urlencoded"
        ["DOCUMENT_ROOT"]=>
        string(26) "/home/footba33/public_html"
        ["GATEWAY_INTERFACE"]=>
        string(7) "CGI/1.1"
        ["HTTP_ACCEPT"]=>
        string(63) "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
        ["HTTP_ACCEPT_CHARSET"]=>
        string(30) "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
        ["HTTP_ACCEPT_ENCODING"]=>
        string(12) "gzip,deflate"
        ["HTTP_ACCEPT_LANGUAGE"]=>
        string(14) "en-gb,en;q=0.5"
        ["HTTP_CACHE_CONTROL"]=>
        string(9) "max-age=0"
        ["HTTP_CONNECTION"]=>
        string(10) "keep-alive"
        ["HTTP_COOKIE"]=>
        string(233) "phpbb3_nfhiu_u=1; phpbb3_nfhiu_k=; phpbb3_nfhiu_sid=dc050c7e193dc87bb89825ee898f9781; style_cookie=null; phpbb3_7rsoy_k=; phpbb3_7rsoy_u=2; phpbb3_7rsoy_sid=2fe48d284c54fe446ebe9c196824625c; PHPSESSID=8e49aa1d1cbc3bb131689acd465d7a3f"
        ["HTTP_HOST"]=>
        string(20) "www.footballtrip.net"
        ["HTTP_KEEP_ALIVE"]=>
        string(3) "115"
        ["HTTP_REFERER"]=>
        string(40) "http://www.footballtrip.net/fixtures.php"
        ["HTTP_USER_AGENT"]=>
        string(88) "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3"
        ["PATH"]=>
        string(13) "/bin:/usr/bin"
        ["QUERY_STRING"]=>
        string(0) ""
        ["REDIRECT_STATUS"]=>
        string(3) "200"
        ["REMOTE_ADDR"]=>
        string(14) "90.212.231.148"
        ["REMOTE_PORT"]=>
        string(5) "52045"
        ["REQUEST_METHOD"]=>
        string(4) "POST"
        ["REQUEST_URI"]=>
        string(13) "/fixtures.php"
        ["SCRIPT_FILENAME"]=>
        string(39) "/home/footba33/public_html/fixtures.php"
        ["SCRIPT_NAME"]=>
        string(13) "/fixtures.php"
        ["SERVER_ADDR"]=>
        string(12) "69.175.67.90"

Link to comment
Share on other sites

No worries.

 

OK, Looks like the HTML for the table is printed, are you saying it is not showing up on the page?

 

Remove that var_dump() line you added, and post the HTML source of the page here.

Link to comment
Share on other sites

I will try and make it a bit clearer.

 

The form is showing the right results as the page is. The only problem is when i try to add anything whether it is an image, divs or even text the team name shows but the fixture link is removed and nothing is being shown.

 

So anything added after this means that the fixture link is removed and whatever you have tried to add does not show up either.

 


<td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'> Fixtures</a></td>

 

<?php # register.php

// This is the registration script for the site

require_once ('./includes/config.inc.php');

// Set the page title and header

$page_title = 'Team Fixture Lists';

include ('./includes/header.html');

?>

    	<div id="fixture_content_container">
        	
            <div id="content_header">
            </div>

    <h1> Search Team Fixture Lists
    <br />
<br />

<p>To view your teams fixture list please use the search function below. </p>
    <p> ** For legal reasons Football Trip.net are not allowed to list fixtures on the site.**</p></h1>

<div id="fixture_search">

<form action="fixtures.php" method="post" />

	<p class="team_name"><label> Football Team Supported: </label> 
        <select name="team_name">	
        <option>Accrington Stanley</option>
        <option>Aldershot</option>
        <option>Arsenal</option>
        <option>Aston Villa</option>
        <option>Barnet</option>
        <option>Barnsley</option>
        <option>Birmingham City</option>
        <option>Blackburn Rovers</option>
        <option>Blackpool</option>
        <option>Bolton</option>
        <option>Bournemouth</option>
        <option>Bradford City</option>
        <option>Brentford</option>
        <option>Brighton</option>
        <option>Bristol City</option>
        <option>Bristol Rovers</option>
        <option>Burton Albion</option>
        <option>Bury</option>
        <option>Cardiff City</option>
        <option>Carlisle</option>
        <option>Charlton Athletic</option>
        <option>Chelsea</option>
        <option>Cheltenham Town</option>
        <option>Chesterfield</option>
        <option>Colchester United</option>
        <option>Coventry City</option>
        <option>Crewe Alexandra</option>
        <option>Crystal Palace</option>
        <option>Dagenham and Redbridge</option>
        <option>Darlington</option>
        <option>Derby County</option>
        <option>Doncaster Rovers</option>
        <option>Everton</option>
        <option>Exeter City</option>
        <option>Fulham</option>
        <option>Gillingham</option>
        <option>Grimsby Town</option>
        <option>Hartlepool United</option>
        <option>Hereford United</option>
        <option>Huddersfield Town</option>
        <option>Hull City</option>
        <option>Ipswich Town</option>
        <option>Leeds United</option>
        <option>Leicester City</option>
        <option>Leyton Orient</option>
        <option>Lincoln City</option>
        <option>Liverpool</option>
        <option>Macclesfield Town</option>
        <option>Manchester City</option>
        <option>Manchester United</option>
        <option>Middlesbrough</option>
        <option>Millwall</option>
        <option>Milton Keynes Dons</option>
        <option>Morecambe</option>
        <option>Newcastle United</option>
        <option>Northampton Town</option>
        <option>Norwich</option>
        <option>Nottingham Forest</option>
        <option>Notts County</option>
        <option>Oldham Athletic</option>
        <option>Peterborough United</option>
        <option>Plymouth Argyle</option>
        <option>Port Vale</option>
        <option>Portsmouth</option>
        <option>Preston North End</option>
        <option>Queens Park Rangers</option>
        <option>Reading</option>
        <option>Rochdale</option>
        <option>Rotherham United</option>
        <option>Scunthorpe United</option>
        <option>Sheffield United</option>
        <option>Sheffield Wednesday</option>
        <option>Shrewsbury Town</option>
        <option>Southampton</option>
        <option>Southend United</option>
        <option>Stockport</option>
        <option>Stoke City</option>
        <option>Sunderland</option>
        <option>Swansea City</option>
        <option>Swindon Town</option>
        <option>Torquay United</option>
        <option>Tottenham Hotspur</option>
        <option>Tranmere Rovers</option>
        <option>Wallsall</option>
        <option>Watford</option>
        <option>West Bromwich Albion</option>
        <option>West Ham United</option>
        <option>Wigan Athletic</option>
        <option>Wolverhampton Wanderers</option>
        <option>Wycombe Wanderers</option>
        <option>Yeovil Town</option>
        </select>


   <p class="submit">
<input type="submit" name="submit" value="Search" />
           
</form>

</div>

<div id="fixtures_confirmation">


<?php

$error = null;

if(isset($_POST['submit'])){ // Search form

// Do the search query here first:

require_once ('../mysql_connect.php');

// Santize Post code and team supported. (Santitize both, never use trim or other similar functions when santizing input.)

if (

mysql_real_escape_string( $_POST['team_name'])

) {

// Select every column from the table where conditions match:

$query = "SELECT * FROM teams WHERE team_name LIKE '%" . $_POST['team_name'] .  "%'";

$result = mysql_query($query) or trigger_error("Query: $query\n<br />MySQL Error: ".mysql_error());

$_SESSION['indexsearch_result'] = array();

while($row = mysql_fetch_array($result)){
$_SESSION['indexsearch_result'] = $row;
}

} else {

// Save error as string, so we can use it how we wish later.

$error = '<center><p><font color ="red">Team Name contains either; one or more invalid characters, or too many/too little characters.</font></p></center>';
}
}

if(!isset($_SESSION['indexsearch_result']) || $error != null){ // No Search or errors
echo(($error != null)? $error : "");

}else{

echo('

<table width="600" height="100" border="0" />
<thead>    
  <tr>

<th scope="col">Team Name</th>

<th scope="col">Fixture List URL</th> 
  </tr>
</thead>');

echo('

<tbody>
<tr>

<td>'.$_SESSION['indexsearch_result']['team_name'].'</td>

<td><a target="_blank" href="'.$_SESSION['indexsearch_result']['url'].'> Fixtures</a></td>
</tr>
</tbody>
</table>'); 

// End echoing result.

}

?>

</div>

<?php
// Include the HTML footer.
include ('./includes/footer.html');
?>

Link to comment
Share on other sites

Adding anything after this removes the link from the table and does not show what you have tried to add to the page.

 


<td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/b/birmingham_city/fixtures/default.stm> Fixtures</a></td>

 


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" 
      type="image/png" 
      href="../images/favicon.png"/>

<title>Team Fixture Lists</title>

<style type="text/css" mdeia="screen">
@import "./includes/layout.css";
</style>

</head>
<body background="../images/background.png">

<div id="container">

<div id="slimtop">
    </div>
    
    <div id="small_login">
    
    <form action="login.php" method="post">

    <p class="email">
    <label> E-Mail: </label>
      <input type="text" name="email" id="email" value=""/>

    </label>
    
    <p class="password"><label> Password: </label> 
    <input type="password" name="pass" maxlength="20" />
    
    <p class="submit">
<input type="submit" name="submit" value="Login" />
            
     </form>
       
    </div>
    
    <div id="ft_logo">

    </div>
    
    	<div id="middle_container">
               
<div id="navigation_container">
        
        	<div id="navigation_header">
            </div>

<p><img src="/images/home.png" width="20" height="20" alt="home" title="home" align="baseline" border="0" hspace="10" /><a href="index.php">Home<br /></a></p>
            
<p><img src="/images/register.png" width="20" height="20" alt="Register" title="Register" align="baseline" border="0" hspace="10" /><a href="register.php">Register<br /></a></p>

<p><img src="/images/navbarlogin.png" width="20" height="20" alt="Login" title="Login" align="baseline" border="0" hspace="10" /><a href="login.php">Login<br /></a></p>

<p><img src="/images/forgotpassword.png" width="20" height="20" alt="Forgot Password" title="Forgot Password" align="baseline" border="0" hspace="10" /><a href="forgot_password.php">Forgot Password<br /></a></p>

<p><img src="/images/aboutus.png" width="20" height="20" alt="About Us" title="About Us" align="baseline" border="0" hspace="10" /><a href="aboutus.html">About Us<br /></a></p>
<p><img src="/images/fixtures.png" width="20" height="20" alt="Fixtures" title="Fixtures" align="baseline" border="0" hspace="10" /><a href="fixtures.php">Team Fixtures<br /></a></p>

<img src="/images/forums.png" width="20" height="20" alt="Football Trip.net Forums" title="Football Trip.net Forums" align="baseline" border="0" hspace="10" /><a href="forums" target="_blank">Forums</a>

        <div id="third_party_links">
        
        <img src="../images/facebook_32.png" width="32" height="32" alt="Football Trip.net Facebook" title="Football Trip.net Facebook" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a>

        
        <img src="../images/twitter_32.png" width="32" height="32" alt="Football Trip.net Twitter" title="Football Trip.net Twitter" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a>
        
        <img src="../images/email_32.png" width="32" height="32" alt="E-Mail Football Trip.net" title="E-Mail Football Trip.net" align="baseline" border="0" hspace="9" /><a href="" target="_blank"></a>
        
        </div>            
            
        </div>


<!-- End of Header !-->

    	<div id="fixture_content_container">
        	
            <div id="content_header">
            </div>

    <h1> Search Team Fixture Lists
    <br />
<br />

<p>To view your teams fixture list please use the search function below. </p>
    <p> ** For legal reasons Football Trip.net are not allowed to list fixtures on the site.**</p></h1>

<div id="fixture_search">

<form action="fixtures.php" method="post" />

	<p class="team_name"><label> Football Team Supported: </label> 
        <select name="team_name">	
        <option>Accrington Stanley</option>
        <option>Aldershot</option>
        <option>Arsenal</option>
        <option>Aston Villa</option>

        <option>Barnet</option>
        <option>Barnsley</option>
        <option>Birmingham City</option>
        <option>Blackburn Rovers</option>
        <option>Blackpool</option>
        <option>Bolton</option>

        <option>Bournemouth</option>
        <option>Bradford City</option>
        <option>Brentford</option>
        <option>Brighton</option>
        <option>Bristol City</option>
        <option>Bristol Rovers</option>

        <option>Burton Albion</option>
        <option>Bury</option>
        <option>Cardiff City</option>
        <option>Carlisle</option>
        <option>Charlton Athletic</option>
        <option>Chelsea</option>

        <option>Cheltenham Town</option>
        <option>Chesterfield</option>
        <option>Colchester United</option>
        <option>Coventry City</option>
        <option>Crewe Alexandra</option>
        <option>Crystal Palace</option>

        <option>Dagenham and Redbridge</option>
        <option>Darlington</option>
        <option>Derby County</option>
        <option>Doncaster Rovers</option>
        <option>Everton</option>
        <option>Exeter City</option>

        <option>Fulham</option>
        <option>Gillingham</option>
        <option>Grimsby Town</option>
        <option>Hartlepool United</option>
        <option>Hereford United</option>
        <option>Huddersfield Town</option>

        <option>Hull City</option>
        <option>Ipswich Town</option>
        <option>Leeds United</option>
        <option>Leicester City</option>
        <option>Leyton Orient</option>
        <option>Lincoln City</option>

        <option>Liverpool</option>
        <option>Macclesfield Town</option>
        <option>Manchester City</option>
        <option>Manchester United</option>
        <option>Middlesbrough</option>
        <option>Millwall</option>

        <option>Milton Keynes Dons</option>
        <option>Morecambe</option>
        <option>Newcastle United</option>
        <option>Northampton Town</option>
        <option>Norwich</option>
        <option>Nottingham Forest</option>

        <option>Notts County</option>
        <option>Oldham Athletic</option>
        <option>Peterborough United</option>
        <option>Plymouth Argyle</option>
        <option>Port Vale</option>
        <option>Portsmouth</option>

        <option>Preston North End</option>
        <option>Queens Park Rangers</option>
        <option>Reading</option>
        <option>Rochdale</option>
        <option>Rotherham United</option>
        <option>Scunthorpe United</option>

        <option>Sheffield United</option>
        <option>Sheffield Wednesday</option>
        <option>Shrewsbury Town</option>
        <option>Southampton</option>
        <option>Southend United</option>
        <option>Stockport</option>

        <option>Stoke City</option>
        <option>Sunderland</option>
        <option>Swansea City</option>
        <option>Swindon Town</option>
        <option>Torquay United</option>
        <option>Tottenham Hotspur</option>

        <option>Tranmere Rovers</option>
        <option>Wallsall</option>
        <option>Watford</option>
        <option>West Bromwich Albion</option>
        <option>West Ham United</option>
        <option>Wigan Athletic</option>

        <option>Wolverhampton Wanderers</option>
        <option>Wycombe Wanderers</option>
        <option>Yeovil Town</option>
        </select>


   <p class="submit">
<input type="submit" name="submit" value="Search" />
           

</form>

</div>

<div id="fixtures_confirmation">

<table width="600" height="100" border="0" />
<thead>    
  <tr>

<th scope="col">Team Name</th>

<th scope="col">Fixture List URL</th> 
  </tr>

</thead>

<tbody>
<tr>

<td>Birmingham City</td>

<td><a target="_blank" href="http://news.bbc.co.uk/sport1/hi/football/teams/b/birmingham_city/fixtures/default.stm> Fixtures</a></td>
</tr>
</tbody>
</table>
</div>

<!-- End of Content --!>

</div>

</body>
</html>

Link to comment
Share on other sites

if (
mysql_real_escape_string( $_POST['team_name'])
) {

 

This won't protect you from anything.

 

if (
$_POST['team_name'] = mysql_real_escape_string( $_POST['team_name'])
) {

 

This will, however does not make any sense because as long team_name contains some text this will always return true.

 

while($row = mysql_fetch_array($result)){
$_SESSION['indexsearch_result'] = $row;
}

 

This will overwrite indexsearch_result on each loop. Looking at the rest of your code I assume this should have been:

 

$_SESSION['indexsearch_result'] = mysql_fetch_assoc($result);

Link to comment
Share on other sites

I think what you should take from this (alongside the very important points Ignace is bringing up), is that to troubleshoot something not showing up properly on a web page, you gotta read its source. And when you can't see the error right there when reading the source, copy and paste it into a syntax highlighting editor. That really helps.

 

Talk to you later!

 

p.s. Seriously look into what Ignace is saying, because it is important.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.