adam291086 Posted January 15, 2008 Share Posted January 15, 2008 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; ?> Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439929 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 Still the same i'm afraid. Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439932 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 i just edited the code so try again Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439934 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 i just edited the code so try again Where is the code adam? Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439940 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 <?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 Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439941 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 Still the same. I've got no idea why the stripped down page won't work. Is the ID being passed over correctly from the previous page? Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439943 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439946 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 id from the databasematch date from the database2008-05-17id from the URL3 Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439948 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439953 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 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 />"; Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439955 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 That's all working fine Adam. Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439964 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 mixture of me being tired and not really concentrating. Sorry. Hope you can get it all working now. Also don't for get "topic solved" Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439968 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 I'd like to say thanks very much for your help - you've been extremely helpful. I really appreciate it. Just so I know, what did you change to make the difference. Was it the id name? Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439973 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 There were a few errors in your syntax. You should read up on while loops that was the main problem Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439981 Share on other sites More sharing options...
giraffemedia Posted January 15, 2008 Author Share Posted January 15, 2008 Will do. I've really got the php bug after years of html and it's opened up a whole new world. Thanks again for the help. James Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439993 Share on other sites More sharing options...
adam291086 Posted January 15, 2008 Share Posted January 15, 2008 Yeah once i started doing php the thing i was able to accomplish was amazing. I have been doing php for a couple of month and have bearly touched the subject. I am learning something new everytime i log into the board Quote Link to comment https://forums.phpfreaks.com/topic/86121-solved-really-need-help/page/2/#findComment-439997 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.