Hi Seyrich,
Sure no problem. For the second query it doesn't know how to use $_GET['carving'], there's no record number on the end of the url so it's just returning the first record it finds in the database.
Here's what whereRecordNumberInUrl(1) does:
If there's a number on the end of the url it returns: num = '$num'.
So in the case of this url: http://warther.org/index1.php?page=carvingsDetail&carving=2
These two would do the same thing:
'where' => whereRecordNumberInUrl(1),
'where' => " num = '2' ",
If there's no number on the end of the url it returns the value in the brackets. When that is 1 it just returns the first record found (any record).
So for this url: http://warther.org/index1.php?carving=2&page=carvingsDetail
These two would do the same thing:
'where' => whereRecordNumberInUrl(1),
'where' => " 1 ",
If you know you're always going to have the record number in $_GET['carving'] you could use that like this:
'where' => "num = '" .mysql_real_ecape_string(@$_GET['carving']). "'",
Hope that helps, let me know if you have any other questions about that.
Dave Edis - Senior Developer
interactivetools.com