Jump to content

[SOLVED] Really Need Help


giraffemedia

Recommended Posts

My fault i was tired and messed up the code. Try now

 

<?php
error_reporting(E_ALL);	
//Start session
session_start();
//Check whether the session variable
//SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) {
header("location: library/access_denied.php");
exit();
}

include('../includes/config.php');
include('../includes/opendb.php');
$match_id = $_GET['id']
$query="SELECT * FROM matches WHERE match_id = '$match_id'";
$result=mysql_query($query)
$numrows=mysql_num_rows($result);
while($row=mysql_fetch_array($result))
{

$id = $row['id'];
$match_date = $row['match_date'];
}
echo $id;
echo $match_date;
?>

<?php
error_reporting(E_ALL);	
//Start session
session_start();
//Check whether the session variable
//SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) {
header("location: library/access_denied.php");
exit();
}

include('../includes/config.php');
include('../includes/opendb.php');
$match_id = $_GET['id']
$query="SELECT * FROM matches WHERE match_id = '$match_id'";
$result=mysql_query($query)
$numrows=mysql_num_rows($result);
while($row=mysql_fetch_array($result))
{

$id = $row['id'];
$match_date = $row['match_date'];
}
echo $id;
echo $match_date;
?>

 

i edited the post above

neither to i

 

<?php
error_reporting(E_ALL);	

include('../includes/config.php');
include('../includes/opendb.php');
$match_id = $_GET['id'];
$query="SELECT * FROM matches WHERE match_id = '$match_id'";
$result=mysql_query($query) or die('Error: ' . mysql_error());
while($row=mysql_fetch_array($result))
{

$id = $row['id'];
$match_date = $row['match_date'];
}
echo "id from the database".$id;
echo "match date from the database".$match_date;
echo "id from the URL".$match_id;
?>

 

what is the result form this

id from the databasematch date from the database2008-05-17id from the URL3

 

My id column is called match_id. If I change

$id = $row['id'];

to

$id = $row['match_id'];

I get 'id from the database3match date from the database2008-05-17id from the URL3'

 

Looks like the id column has been missing the match_ bit

edit now follow these steps

 

 

Now add in the rest of the feild from the database to the while loop folling this example

 

$this is your variable name = $row['add the feild names here'];

 

 

Then at the bottom echo the variable out with a <br>

echo $match_date;
echo "<br />";

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.