You are here: Updating Multiple Rolls Using PHP « PHP Programming Language « IT news, forums, messages
Updating Multiple Rolls Using PHP

Posted by chimambo on 08/17/07 14:25

Hi All,
I have a little problem. I am retrieving records from a table and I
want to update the records using checkboxes. I am able to display the
database record quite alright and I have created an array of
checkboxes, but my update loop is not working. Here is my code:
/*---------This retrieves the records -------------*/
if($row_md)
{
do{
echo "<tr><td text align='right'>";
echo date('d-m-Y', strtotime($row_md['med_date']));
echo "</td>";
echo "<td text align='left'>";
echo $row_md['drug_desc'];
echo "</td>";
echo "<td text align='left'>";
echo $row_md['dose'];
echo "</td>";
echo "<td>";
echo "<input type='checkbox' name=stop[] value='N'>";
echo "</td></tr>";
}
while($row_md = mysql_fetch_assoc($md));
/*
-----------------------------------------------------------------------------------------------
*/
/*--------------This should update the records but its not working
----------*/

while (list ($key,$val) = @each ($stop))
{
$mysql_query="UPDATE irdb_temp_medication
SET active = '$val'
WHERE h_number = '$hos_no')";
}

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация