Jump to content

THUNDER_CHILD

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

THUNDER_CHILD's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i tried this [code=php:0] while($row = mysql_fetch_array( $coulmnlist )) { //where $columnlist is in place of $your_new_aray $column1 = $row['o']; $column2 = $row['1']; $column3 = $row['2']; $column4 = $row['3']; } [/code] but if i try to echo $column1 it errors out on me.
  2. not exactly.  the code that i posted recives the names of the columns of a table, and now thanks to andyb thoes codes now reside in a variable outside of the loop.  The variable holds info like column1, column2, column3, etc. I just want to extract thoes bit's of info into their own variable.  $column1name = column1, $column2name = column2, $column2name = column2, etc. i hope i made it more clear.
  3. Thank You. That helps me get it out of the statement but i am still not sure how to extract the information in the array to individual variables. E.g. i want to take $your_new_array, extract the data in there (a, b, c, d ,e, etc.) and assign each one to a variable $a = a, $b = b, $c = c, etc.
  4. Ok so what i am trying to do is extract the text that is echo'd into a variable.  this is the code i am working with [code=php:0]$result = mysql_query('select * from disp'); if (!$result) {   die('Query failed: ' . mysql_error()); } /* get column metadata */ $i = 0; while ($i < mysql_num_fields($result)) {   echo "Column $i:<br />\n";   $meta = mysql_fetch_field($result, $i);   if (!$meta) {       echo "No information available<br />\n";   }   echo "<pre> name:        $meta->name </pre>";   $i++; }[/code] What I would like to do is assign each $meta->name to a separate variable that can be used outside of the loop.  What the loop does is returns the names of all of the columns within a database and I would like to use them dynamically outside of the loop.
×
×
  • 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.