reisuke Posted July 22, 2009 Share Posted July 22, 2009 Hi everyone i am trying to do this , but i have no idea , any clues or source that i can look for? I have 2 fields , serialno and cardname So when i type 3 serialno in a textbox. eg. 1500,1600,1700 it will then retrieve data from php to display the cardname of the serialno . eg. from 1500,1600,1700 into John,Paul,Timmy anyway i am doing it in flash , but i want to write the codes in .php ,but i am not very sure all i know is i going to do a : Split<|> to have "," an array and a for loop anyone can help me? Quote Link to comment https://forums.phpfreaks.com/topic/166925-retrieve-data-from-single-textbox/ Share on other sites More sharing options...
reisuke Posted July 23, 2009 Author Share Posted July 23, 2009 For those who don't understand: i have this textbox inside my flashfile i created 2 fields in MYSQL database - serialno and cardname when i type in the textbox "1500, 1600, 1700" (serialno) , it will then change to "tom, dick, harry" which is the (cardname) because beforehand i registered in MYSQL 1500 = tom 1600 = dick 1700 = harry Quote Link to comment https://forums.phpfreaks.com/topic/166925-retrieve-data-from-single-textbox/#findComment-881199 Share on other sites More sharing options...
mmarif4u Posted July 23, 2009 Share Posted July 23, 2009 If you are doing it like this way: 1500,1600,1700. mean using comma to separate. So i will do it like this way: $serial = explode(",",$serial); $serial[0]; $serial[1]; $serial[2]; Or may be some one have better idea than this. Quote Link to comment https://forums.phpfreaks.com/topic/166925-retrieve-data-from-single-textbox/#findComment-881203 Share on other sites More sharing options...
reisuke Posted July 23, 2009 Author Share Posted July 23, 2009 Hi sir , thanks a lot for replying the part that i dont know how to do is from "1500, 1600, 1700" it will turn to "tom, dick, harry" in the textbox i think it works like a search engine that search keywords in MYSQL database. if i search "1500" , results will be "tom" i am not very well versed in PHP/Flash , i am actually looking for tutorials clues on what shall i do thanks a lot ! Quote Link to comment https://forums.phpfreaks.com/topic/166925-retrieve-data-from-single-textbox/#findComment-881224 Share on other sites More sharing options...
mmarif4u Posted July 23, 2009 Share Posted July 23, 2009 If you have stored name for that specific number in database, then that is more easy to implement. Lets say, 1500 is for tom. Run a query, get the desired results from it. Do u have any sort of query to do that? then use if statement: if ($serial[0] == $name){ $name1= $name; } OR if have saved that names also like the numbers, you can use explode function to separate it and then compare it as i write above. Quote Link to comment https://forums.phpfreaks.com/topic/166925-retrieve-data-from-single-textbox/#findComment-881257 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.