Hi guys, I have this problem that I can not resolve.
I have to control if inside the file txt there are variables.
If there are not I have to insert these variables.
My script is the seguent:
$fp=file("../erogazione_artl.txt");
while(list($key,$val)=each($fp)) {
list($txt_id,$txt_nome,$txt_cognome,$txt_indirizzo)=explode("|",$val);
if ($txt_id== $id){
echo"<br>già esiste<br>";
}else{
function for insert into txt.....
}
}
The fact is that this script is inside a loop "for" therefore the checking is repeating two times.
the first one for the loop "for" that finds all the "$id" from the table and the second one,
for the loop "while" that reads the file txt and finds "$txt_id"
Hi everybody and thanks anyway.
Giuseppe