Okay.. I need to get an ID out of one table and cross reference it with another table (the other table's primary key is this ID)
I have this, but I have an odd sensation that I can do this in one sql statement..
$sql = "SELECT id from {$DB_CONF["table_images_images"]}
where directory = '".addslashes($directory)."' AND
filename = '".addslashes($filename)."' AND
accountid = '$id' AND
public = '$public'";
// comment out for production due to download errors.
//print_hidden($sql);
//print_hidden($file);
$sql_result = mysql_query($sql)
or die ("Couldn't execute query. (message_database()) ".mysql_error());
$idtag = mysql_result($sql_result,0,"id");
$sql = "SELECT file from {$DB_CONF["table_images_images_images"]}
where image_id = '$idtag'";
// comment out for production due to download errors.
//print_hidden($sql);
//print_hidden($file);
$sql_result = mysql_query($sql)
or die ("Couldn't execute query. (message_database()) ".mysql_error());
$data = mysql_result($sql_result,0,"file");
any insight?
k.