I have a pretty annoying problem on my hands. I need to output two sets of data from my database in two columns. One column has to have the even numbered results, and the other needs the odds. Initially to do this I used these two statements, and they worked wonderfully:
$sql1 = "SELECT * FROM hc_gallery WHERE MOD(id,2) = 1 LIMIT 3;";
$sql2 = "SELECT * FROM hc_gallery WHERE MOD(id,2) = 0 LIMIT 3;";
unfortunately I need to have an additional conditional added for other sections of my script, and this is where I run into problems. I need to have the even and odd numbered results from hc_gallery where the category is equal to a specific string. I have no idea how to get this to work correctly. Here is one (of the many) ways I've tried to do it:
$sql1 = "SELECT * FROM hc_gallery WHERE MOD(category = 'Members',2) = 1;";
$sql1 = "SELECT * FROM hc_gallery WHERE MOD(category = 'Members',2) = 0;";
I've also tried:
$sql1 = "SELECT * FROM hc_gallery WHERE category = 'Members' and MOD(id,2) = 1;";
$sql2 = "SELECT * FROM hc_gallery WHERE category = 'Members' and MOD(id,2) = 0;";
none of those queries give me the correct result set. any help would be greatly appreciated!