And since each cid number is assigned a category, I was hoping to find out if there was a way to write the code to reflect this.
For example:
cid 10 = poker
cid 11 = casino
Yeah, I know what you mean…. Somewhere along the way, the query that calls for the information in your database needs to get the data associated with cid10, cid11, etc… If each cid is assigned to a unique category name, you can make this work by calling for the category name (instead of the cid number) in the query.
For example, change
$query = “SELECT * FROM tablename WHERE cid = 10”;
to
$query = “SELECT * FROM tablename WHERE categoryname = ‘poker'”;
(be careful to include the single and double quotes in the right places)
If the category name is contained in the URL, first you could “GET” the category name and then insert it into the new query, like this:
$cat_name=$_GET;
$query = “SELECT * FROM tablename WHERE categoryname = ‘$cat_name'”;
The URL where it retrieves the cid from would look like this, for example:
yoursite.com/helpful_links/2/poker.php
which, from the .htaccess file, would be rewritten to look like this behind the scenes:
yoursite.com/helpful_links.php?pg=2&cid=poker
Hopefully this works out for you. Good luck! 