Simple problem here I just can’t get it…
I have 2 session variables
$cat1 = $_SESSION[‘catCheck1’];
$cat2 = $
In my SELECT, I have a for loop. All I want to do is get the variable names $cat1 and $cat2 passed to it like this:
[code]
for ( $i = 1; $i <= 2; $i++) {
$query = mysql_query(“SELECT * FROM category WHERE categoryID = $cat”.$i.” ORDER BY categoryName”);
However, my select doesn’t like it and it select nothing. But if I put in the actual variable name like this, it works just great!
[code]
for ( $i = 1; $i <= 2; $i++) {
$query = mysql_query(“SELECT * FROM category WHERE categoryID =”. $cat1.” ORDER BY categoryName”);
while ($getName = mysql_fetch_array($query)) {
etc….
What in the devil am I doing wrong with this select to get it to read the variable name right?