/ Published in: PHP
URL: http://www.jeffkilroy.com
Use this function to pull all columns from a single database field. getrowdata(tablename,rowid,prefix);
You would call this function like: getrowdata("users",$SESSION['user'],"user");
The prefix is the prefix you want for the array names, so if I have a field in my "users" table called "username", the example above would output the variable "$user_username = 'data';"
Expand |
Embed | Plain Text
function getrowdata($tablename,$rowid,$prefix){ //Get field data foreach($field_array as $field_key=>$field_value){ //Setup a global variable name for this data based on prefix } } }
You need to login to post a comment.
