Jump to content

RopeADope

Members
  • Posts

    157
  • Joined

  • Last visited

Everything posted by RopeADope

  1. Hi all. The following is a function to get and display data. However, I've hit a wall in my progress. It's only printing out one field. I need to have it print out every retrieved field. Any help is appreciated. function get_data($table_name){ $result=mysql_query("SELECT * FROM $table_name"); $num=mysql_num_rows($result); $i=0; while($i < $num){ $fields=mysql_fetch_field($result,$i); $display_fields=mysql_result($result,$i,$fields->name); echo $display_fields; $i++; }; }; I realized that (I think) I need the $display_fields var to be concatenated with the $i variable so there's a unique var name for each field retrieved from the mysql_fetch_field line. Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.