Hi all,
Im having trouble to get the beneath script to work the thing i can't seem to get workin is the following.
The page requests the data from a mysql table using mysql array so there are mutliple row's every row has 3 data
colloms 1 id (auto increment) 2 Module name 3 status. after every row the is a submit button so you can submit data from that row (basilcy a on and off button) when i have more than 1 row it doesnt work.
With 1 row it works but have to press the submitt buton twice.
Any help will be appreciated
Regards Djunity
<div class="content">
<br />
<a href="?page=view">Module overzicht</a> <br />
<br / >
<p><a href="?page=add" class="button"><span class="ui-icon ui-icon-plusthick"> </span>Module toevoegen </a></p>
<table id="myTable" class="tablesorter" style="width: 100%;" border="0" cellpadding="0" cellspacing="1" > <thead>
<tr>
<td height="25px" width="120"><b> Module naam:</b></td>
<td height="25px" width="60"><b> Status:</b></td>
<td height="25px"width="70"><b> Actie:</b></td>
</tr>
</thead>
<?
// get results from database
$result = mysql_query("SELECT * FROM Wefact_Modules ORDER BY id")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
$form = $row['module'];
$id = $row['id'];
?>
<tbody>
<form method="post" name="form" action="?page=view">
<input type="hidden" name="id" value="<?php echo $id; ?>"/>
<input type="hidden" name="action2" value="action">
<tr class="hover">
<td height="35px"><? echo $row['module']; ?></td>
<td height="35px"><? if ($row['status'] == 1) {
echo "<font color='#00FF00'>Online</font>";
}else if ($row['status'] == 0){
echo "<font color='#FF0000'>Offline</font>"; } ?></td>
<td height="35px">
<? if ($row['status'] == 1) { ?>
<input type="hidden" name="status" value="0" /><a href="javascript: document.form.submit();" class="button"><span class="ui-icon ui-icon-minusthick"> </span>Offline</a> <?
}else if ($row['status'] == 0){ ?>
<input type="hidden" name="status" value="1" /><a href="javascript: document.form.submit();" class="button"><span class="ui-icon ui-icon-plusthick"> </span>Online</a> <? } ?> </td>
</form>
</tbody>
<? } ?>
<?
$status = $_POST['status'];
if($_REQUEST['action2'] == 'action') {
$sql = "UPDATE Wefact_Modules SET status='$status' WHERE id='$id'";
$result = mysql_query($sql);
} ?>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>
validating url
im trying to validate url's sent to me by a formthe url's im collecting are for placing banners on my site so the url's are the link to there site and url of where there banner isURL's ARE BROKEN INTO
Strange array issue, never happened before.
mysql_fetch_array returns 1 array per call. Generally that's why it is inserted into a while statement. I generally loop through them in a while statement and put them all in a master array so I
Custom list order
Hi there,I have checked this tutorial and it's great till the point where I want to display my data by a variable. Let's say that I have in my table these fields:- id- name- usort- categoryI want to
Preg_match unknown modifyer
Hello,Im trying to write a little script for my forums i need to get the reply from my forums. Im trying thisCode: $pattern = '/<span
extract content from a website
i have written a code that will grab the content from the index page..i would like to know how can i leech completely thru the site (index,contact, news pages) and grab specific content only like
please hep to get values from a table row
can anyone tel me how I can select and get data from one row by pressing an Edit button in that row?<?phpif (!empty($avil_holidays)){ foreach ($avil_holidays as $val) { switch
Delete all from a table
I can not get the following code to work. If I run the sql statement in the db it will delete all the data but it will not work from the page. My connection string is fine I just can not get it to
Revoking alter any table from a schema
Hi All,
Loop column after 2 results
Hello All.Here is what I have:Client ID Company name Client ID Company nameI then need a script to echo 2 results per row then start a new row.I've tried many
scandir clients directory
hi,how can i scandir the clients directory? i need a script that when i click a button it will upload all the files in the directory$dir =