aarontbarksdale Posted November 25, 2013 Share Posted November 25, 2013 Okay, so, it was working...now it doesn't. PLEASE HELP! NEED IT WORKING TODAY!!! require ('connect.php');$myusername = $_SESSION['myusername'];//Data from Clients table and variables associate$client_table = mysql_query("SELECT * FROM `clients` WHERE client_id = ". $_SESSION['clientid'] ." ") or die(mysql_error());$row = mysql_fetch_assoc($client_table);//Data from Payments table and variables associated$pmt_table = mysql_query("SELECT * FROM `payments` WHERE client_id = ". $_SESSION['clientid'] ." ORDER BY YEAR(pmt_date) ASC") or die(mysql_error());$row2 = mysql_fetch_assoc($pmt_table);$userstate = $row2['userstate']; The ENTIRE report.php file is dependent upon information from the database that carried over via Session from the client's information page with a unique ID number that corresponds to the client_id in the database. I can access all the information in the client info.php, but it's like it doesn't carry over. Please help ASAP! Link to comment Share on other sites More sharing options...
Don E Posted November 25, 2013 Share Posted November 25, 2013 Make sure you have session_start() in the required pages and also make sure $_SESSION['clientid'] have values. Also for SQL query, you don't need single quotes for selecting the table. Example: "SELECT * FROM clients ...." Link to comment Share on other sites More sharing options...
aarontbarksdale Posted November 25, 2013 Author Share Posted November 25, 2013 Make sure you have session_start() in the required pages and also make sure $_SESSION['clientid'] have values. Also for SQL query, you don't need single quotes for selecting the table. Example: "SELECT * FROM clients ...." session_start(); is at the top of every page, first line of code. I'll try removing the ` ` around clients in the table lines to see if that works. Link to comment Share on other sites More sharing options...
aarontbarksdale Posted November 25, 2013 Author Share Posted November 25, 2013 Still doesn't work. Not sure. Link to comment Share on other sites More sharing options...
Don E Posted November 25, 2013 Share Posted November 25, 2013 (edited) Does $_SESSION['clientid'] contain a value? Also try removing the space at the end of the query, like: $client_table = mysql_query("SELECT * FROM clients WHERE client_id = ". $_SESSION['clientid']); Edited November 25, 2013 by Don E Link to comment Share on other sites More sharing options...
thescientist Posted November 25, 2013 Share Posted November 25, 2013 take it one line at a time. Comment things out, debugging/logging as you go until you get to the line causes the issue. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 25, 2013 Share Posted November 25, 2013 What exactly happens when you run the code? Link to comment Share on other sites More sharing options...
aarontbarksdale Posted November 25, 2013 Author Share Posted November 25, 2013 What exactly happens when you run the code? Nothing. The code starts the date at 12/31/1969. No information from the customer's page gets carried over to the report. No payments or anything. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 25, 2013 Share Posted November 25, 2013 Are you saying you get a blank page? No error messages? You didn't show a lot of code, maybe those queries are just not returning any data. Have you printed out the queries to see what you're asking the database for? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now