I'm doing a search function where the user need to input ID number in order to search a person's info. I did search the web on how to do this, but I got stuck when transferring the data back. In my case, I want to transfer every data into their respective textbox. For example :
fullname => fullname textbox
gender => gender textbox
So how do I convert the array into individual php variable and echo it in the textbox? Or there might be any better way? Here is the function on what I've done so far :
function userRetrieve ($cardid) {
$cardid = mysql_real_escape_string($cardid);
$sql = mysql_query("SELECT * FROM `users` WHERE `card_id` = '$cardid'");
$res = mysql_query($sql) or trigger_error(mysql_error().$sql);
$row = mysql_fetch_assoc($res);
if ($row){
//What should I do here?
}
}
Any help would be appreciated. Thank you.