Mysql problem

hello every one !
i would like to know how to assign a database field to a variable
for example i have this database “DBtr” that has a table named “table1”
table1 hast following columns : “id”,“ipadd”,“date”;
i want to read value of ipadd and put it in a variable then i use that variable ,
i tried some sql commands but without success
need helps plz !!

It would help if you showed us what you have tried thus far AND what error messages you are getting