Hi, is there anyone that knows a bit about php and can help me out?

how do i number the selected values or can i use AS to give the ShortName string different values. At the moment it selects the same value for each shortname instead of taking one from each table.

query2 = "SELECT Pictures.ShortName,Categories.ShortName FROM Stats,Pictures,Categories WHERE Pictures.CategoryNo = Categories.CategoryNo AND Stats.PictureNo != Pictures.PictureNo";
while (rs2.next()) {
String pic = rs2.getString("ShortName"); //both different
String cat = rs2.getString("ShortName");