Hello!
I am new to php and working on a search code in mysql using php for my thesis implimentation. I want to search ID of an article in a table ‘dnew’ in another table ‘data’ and then save the id of searched record against the first. searched records may be more than one so I am saving it with a comma. I have written a code which works fine but taking too much time. I want it to be done faster. Can any one help me to do it in a better way to make it faster. Some one told me to use associative arrays as it works like hash maps but I have no luck in that. Please some one help!!!
[php]
$query=mysql_query("SELECT*
FROMdnew
WHERE outlink_papers
=’’
“);
while($roww = mysql_fetch_assoc($query)){
//$ID=1;
$con_id=” ";
$ID=$roww[‘IDD’];
$_SESSION[‘data’]=$roww[‘Outlinks’];
$result1 = mysql_query("SELECT *
FROM `data` WHERE`CitingPapers`LIKE '%".$roww['PID']."%'");
$countt=mysql_num_rows($result1);
while($row = mysql_fetch_assoc($result1)){
$PID=$row['PID'];
$out=$_SESSION['data'];
$con_id=$out.",".$PID;
$_SESSION['data']=$con_id;
}
echo $_SESSION[‘data’];
@session_destroy();
}
[/php]