Thread: id problems
View Single Post
Old 10-17-2012, 07:04 PM   PM User | #1
Kaler40
New to the CF scene

 
Join Date: Oct 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Kaler40 is an unknown quantity at this point
id problems

can anyone help. I have code that reads an sql database(data.php) and a .js page that has a function that uses $.get.json and pulls the information from the data.php page which is then appended to divs on my site pages. This works fine with a basic select* from tablename in the data.php page.

My problem is that I was wanting to use a select satement such as "Select * from tablename where tablefield="$id". Id needs to be the page id, i.e perthcolege has id of 1 in databse so perth college main page id is 1.

I have tried to input this id onto the data.php using both php GET and also session variable. The problem is as soon as I put any item onto data.php to reference the page the details from the database are not displayed onto the page. Can anyone advise me how I can get the page variable id to work on the data.php page.

Just to clarify data.php calls the data in a function and calls the function on the data.php page. Data.php is referenced via the .js page and the js function is referenced in the appropriate college page. Any help would be appreciated.
Kaler40 is offline   Reply With Quote