Hoping someone can help me with this issue I'm having, im trying to batch update records from a result set with pagination. The first page results (first 10 records) will update with the batch, but any other pages will not update.... the pagination coding is preventing the rest of the results to update when a date change is made.
Here's the code im using:
<div class="searchTitle">SCHEDULING</div>
<div class="tabber" id="mytab1">
<div class="tabbertab">
<h2>RECORDS</h2><form name="namestoupdate" method="post" action="updateschedule.php">
<div class="searchTitle">RECORDS<input type='submit' class="submitButton" value='SUBMIT' src="images/submit.png" /></div>
<table cellspacing="0" id="box-table-a">
<tr>
<th>TITLE</th>
<th>DATE</th>
</tr>
<?php
$i = 0;
while ($result_row = mysql_fetch_array($resultbypass)) {
if($i< $startbypass || $i>=$stopbypass) { $i++; continue; }
$i++ ; ?>
<tr>
<td><?php print "<input type='hidden' name='ID[$i]' value='{$result_row['ID']}' />" ?> <?php echo $result_row['Provider']; ?></td>
<td><?php echo $result_row['Title']; ?></td>
<td><?php print "<input type='text' size='8' name='Date[$i]' value='{$result_row['Date]}' maxlength='10' />";
?></td>
</tr>
<?php } ?>
</table>
<?php echo getPaginationString($pagebypass,$totalitemsbypass,$itemsPerPage,1,$targetpage,$pagestringbypass); ?>
</form>
</div>
Batch update script: (updateschedule.php)
<?php
session_start();
include("connect.php");
$size = count($_POST['ID']);
$i = 0;
while ($i <= $size) {
$Date= $_POST['Date'][$i];
$id = $_POST['ID'][$i];
$query = "UPDATE Table
SET Date= '$Date'
WHERE ID = '$id' LIMIT 1";
mysql_query($query) or die ("Error in query: $query");
++$i;
}
mysql_close();
?>
file_put_contents and createimagefromjpeg
All,I do somethings and then I have the following code:file_put_contents('./test/'.$filename,$attachment_raw); //Give full path to $filenameI then do:$im = imagecreatefromjpeg($path_to_image_directory
Converting RGB values to HEX
Code: <?PHP$file_handle = fopen("colors/rgb.csv", "r");while (!feof($file_handle) ) {$line_of_text = fgetcsv($file_handle, 1024);print $line_of_text[2] . $line_of_text[3] .
$_GET problem
Hi all,Have a bit of a problem with a little piece of code, I am not sure if this should be under php or ajax as I am not sure where the problem lies. Basically here is the script:Code:
Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" 'Code: [Select]preg_match_all('#src="(http://[^"]+)#', $value, $matches)I want to modify this so that it only returns
Help With Showing Users On the Index Page
Ive got this code which works just how i want it to.Code: <? $timenow=time();$select = mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER by id ASC");$num =
do while conditions
i want to display 6 images in a 2x3 tablenow what would be the correct logic tocount that there are 6 images resultsand if there are more than 6 images loop and echo the rest but not in the tablebut
PHP Include w/If IE Condition Statement?
I was having a problem with Internet Exploder (big surprise, right?) displaying my drop down menus improperly. I found a solution that works ... I have a PHP file that I place as an include on all my
getting Vars to pass to next page.
Hello all, I have a confusing situation on my hands, i am a member of a gaming community and we are setting up a website (yay i get to be teh techie!!) im not exactly a noob with php but i am by far
Parse error: syntax error, unexpected $end in
hello,i receive the error :Parse error: syntax error, unexpected $end in C:\xampp\xampp\htdocs\helpdesk\users.php on line 372i looked allover the code but i can't find the curly bracket missing or
How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write a tool that will basically do the same thing, but web-based... so the user would enter a URL and