in reply to Inserting data in Mysql

You're doing a single query per file. For instance, with the given two line example, your query will be:
INSERT into userdata (id, name, age, address) values ('22', 'Mark Henr +y Jack Henry', '3528', '82, Linking road, Parkplaza, 5653210, Sudon v +illage, Brownie, 3251')
Assuming you fix the '$nam1' typo. Is that really what you want to do? Note that your id field could easily by '1 2 3 4', which doesn't seem like a very useful id to me.