Hello,
I created a relational query using php. I handled results using mysql_fetch_array(). The problem is that it returns two fields with the same name, and I need to get de second field data. However, I'm only able to get the first one.
This is the code:
$apa_query = "SELECT * ".
"FROM $apa_tables[photos], apa_albums ".
"WHERE $apa_tables[photos].filename LIKE '%$apa_search_query%' AND $apa_tables[photos].filename NOT LIKE '$apa_options[thumb_prefix]' AND apa_albums.ID = apa_photos.album_ID
".
"ORDER BY filename ".
"LIMIT $apa_offset,$apa_photo_per_page";
$apa_result = apa_mysql_query($apa_query,__FILE__,__LINE__);
while($apa_row = mysql_fetch_array($apa_result))
{
print("<tr>\n");
print("<td class=\"common\" align=\"center\">\n");
$apa_param = $apa_param = "apa_album_ID=".$apa_row[album_ID]."&apa_photo_ID=".$apa_row[ID]."&apa_page=1";
$apa_decoded_filename = rawurldecode($apa_row[filename]);
$apa_decoded_thumb = rawurldecode($apa_row[path]);
apa_print_link("photo",$apa_param,"<img src=\"".$apa_module_basedir."albums/".$apa_row[path]."/$apa_options[thumb_prefix]$apa_decoded_filename\" border=\"0\" alt=\"$apa_decoded_filename\">",0);
There is another field in the other table also named ID, but as I said I can't get the data of this one.
Please, what should I change in order to get it working?
Thanks a lot,
Narcís
I created a relational query using php. I handled results using mysql_fetch_array(). The problem is that it returns two fields with the same name, and I need to get de second field data. However, I'm only able to get the first one.
This is the code:
$apa_query = "SELECT * ".
"FROM $apa_tables[photos], apa_albums ".
"WHERE $apa_tables[photos].filename LIKE '%$apa_search_query%' AND $apa_tables[photos].filename NOT LIKE '$apa_options[thumb_prefix]' AND apa_albums.ID = apa_photos.album_ID
".
"ORDER BY filename ".
"LIMIT $apa_offset,$apa_photo_per_page";
$apa_result = apa_mysql_query($apa_query,__FILE__,__LINE__);
while($apa_row = mysql_fetch_array($apa_result))
{
print("<tr>\n");
print("<td class=\"common\" align=\"center\">\n");
$apa_param = $apa_param = "apa_album_ID=".$apa_row[album_ID]."&apa_photo_ID=".$apa_row[ID]."&apa_page=1";
$apa_decoded_filename = rawurldecode($apa_row[filename]);
$apa_decoded_thumb = rawurldecode($apa_row[path]);
apa_print_link("photo",$apa_param,"<img src=\"".$apa_module_basedir."albums/".$apa_row[path]."/$apa_options[thumb_prefix]$apa_decoded_filename\" border=\"0\" alt=\"$apa_decoded_filename\">",0);
There is another field in the other table also named ID, but as I said I can't get the data of this one.
Please, what should I change in order to get it working?
Thanks a lot,
Narcís