Arama ve MySQL sorguları kullanarak bir metin dosyası içinde değiştirin

1 Cevap php

Ben veritabanı tablosundaki her isim için testing.txt dosyayı arama ve veritabanı tablo kimliği ile adını değiştirmek için PHP nasıl oluşturabilirim?

Metin dosyası gibi görünüyor böylece:

3 | 1 | 4 | 5
2 | 3 | 6
4 | 5 | 2
and so forth an so on...

Ben bu gibi görünüyor "nameslist" adında bir mysql tablo vardır:

---------------------
id | name
---------------------
1  | bob
2  | john
3  | tom
and so forth an so on...

Ben bu gibi görünüyor "testing.txt" adlı bir metin dosyası vardır:

tom | bob | mary | paul
john | tom | rachel
mary | paul | john
and so forth an so on...

1 Cevap

SO hoşgeldiniz. Eğer var güzel numara!

Rağmen, soru net değil. Belirli sorun nedir? Bir algoritma?

The easiest way is to read both file and table into arrays and then run a loop other data, replacing names with numbers.
Then write a file over.