Posts: 4
Threads: 1
Joined: Nov 2012
Hey,
i have this code :
Code:
$cmtx_page_id = $id;
$cmtx_reference = $row[name];
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
$id = $_GET['id'];
URL : script.php?id=5
in the MYSQL Database is always the false page id .. from 1 next to 5 ..
Only i have this bug?
Mfg
Posts: 2,873
Threads: 59
Joined: Jun 2010
Hi,
Can you explain what you mean:
(21-Nov-2012, 06:43 PM)Koksi Wrote: always the false page id .. from 1 next to 5 ..
Have
you completed
the interview?
Posts: 4
Threads: 1
Joined: Nov 2012
the script.php?id=51 and the page id in the database is for example 3
Posts: 2,873
Threads: 59
Joined: Jun 2010
There are two ID related columns in the pages database table.
One is called 'id' and the other is called 'page_id'.
The 'page_id' stores the $cmtx_page_id value, in your case 51.
The 'id' is an auto increment column, so it may be 3 in your case.
Have
you completed
the interview?
Posts: 4
Threads: 1
Joined: Nov 2012
I have noticed that in the comments table the page_id is a number.
in pages table the page_id is a string and the id is a number
WHERE comments.page_id = pages.id
but comments.page_id != pages.page_id
seems like an odd naming structure, but that is how it works for me.
I believe the $cmtx_page_id is looking for a string that matches the pages.page_id not the pages.id or the comments.page_id
if you are trying to write a query to get comments or ratings about a page, then you should JOIN the tables WHERE comments.page_id = pages.id
I hope this helps!
Posts: 4
Threads: 1
Joined: Nov 2012
(21-Nov-2012, 08:57 PM)Steven Wrote: There are two ID related columns in the pages database table.
One is called 'id' and the other is called 'page_id'.
The 'page_id' stores the $cmtx_page_id value, in your case 51.
The 'id' is an auto increment column, so it may be 3 in your case.
i know.. but the page_id is not an increment auto column and is not 51..
Posts: 4
Threads: 1
Joined: Nov 2012
I want to tag a comment counter in another div. I wanted to include the Comments table with the Page ID but it doesnt work.