faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 11 people (73%) answered Yes
Recently 6 of 9 people (67%) answered Yes

Entry

How do I display the results of a db query in a different frame to the one that holds the select statement/php code?

Jan 10th, 2004 06:05
smart ikhu-omoregbe, Chris Hill,


$query = mysql_query("select....");//The select query that
                                   //gives each row as an array
 while($row=mysql_fect_row($query)){//the while statement that
                                    // loops around the table
 for($i=0;  $i < mysql_num_fields($query);  $i++)
 echo $row[$i].""; //Displaying the results
  }
/*Post this with a form action as the processor frame; a hidden input  
and a name as element in ENVIRON variable array input.
On the processor frame use the
ENVIRON variables to call the element in arrays
$HTTP_POST_VARS[], $HTTP_GET_VARS[] for older versions or $_POST[], 
$_GET[] for newer versions. Then*/

foreach($HTTP_POST_VARS as $indice => $vars)
{
 $row[$i] and so on
}


Note: $indice is the key.
 I hope this helps ('.')