RE: [PHP-DB] Creating an array of mySQL results with PHP

From: Date: Tue, 12 Mar 2002 07:10:22 +0000
Subject: RE: [PHP-DB] Creating an array of mySQL results with PHP
Groups: php.db 
Request: Send a blank email to php-db+get-17622@lists.php.net to get a copy of this message
Actually, you want the value of the input to be just "$classroom". That is because it is within the while loop. Can I ask for a little more information regarding the structure of the table that you are querying--what is(are) the primary keys in the table; I am assuming that the "week_no" field is the primary key. I am sorry for the confusion--the complete code for outputting the input form follows (minus the appropriate form tags). ###SNIP#### echo "<table>"; while ($row = mysql_fetch_array($result)) { $week_no = $row['week_no']; $week_date = $row['week_date']; $parent_id = $row['parent_id']; $student_id = $row['student_id']; $class_id = $row['class_id']; $classroom = $row['classroom']; $homework = $row['homework']; $library = $row['library']; $fieldtrip = $row['fieldtrip']; $pta = $row['pta']; $mast = $row['mast']; $meetings = $row['meetings']; $other = $row['other']; echo <<<EOD <tr><td align=\"center\"> <input type=\"text\" name=\"log[$week_no][classroom]\" value=\"$classroom\"> </td></tr> EOD; } echo "</table><"; ###SNIP#### > -----Original Message----- > From: John Hughes, Jomari Works [mailto:john@jomari.com] > Sent: Monday, March 11, 2002 11:03 PM > To: Shrock, Court; php-db@lists.php.net > Subject: Re: [PHP-DB] Creating an array of mySQL results with PHP > > > OK. I can see how that works, assuming that the value would be > \"log[$week_no][classroom]\" as well. > > What would the mysql_fetch_array look like?

« previous php.db (#17622) next »