Search found 3 matches

by happypete
Thu Mar 24, 2011 9:06 pm
Forum: PHP - Code
Topic: Renumber row in sequential order using PDO
Replies: 1
Views: 194

Renumber row in sequential order using PDO

I have a table with an ID column which is the Primary key and auto incremented. I have another column named ORDER that contains a number. This number is used to define the order in which the row data is displayed on a page. When I delete a row, the ORDER column will have a gap and I would like to re...
by happypete
Thu Mar 24, 2011 2:38 pm
Forum: PHP - Code
Topic: updating a database with a loop/array/foreach ??
Replies: 1
Views: 180

Re: updating a database with a loop/array/foreach ??

sorted it :) Here is the working code: <input type="text" name="dates[<?php echo $e2['id']; ?>]" maxlength="20" value="<?php echo $e2['dates']; ?>" class="rates" /> <input type="text" name="night[<?php echo $e2['id']; ?>]" maxleng...
by happypete
Thu Mar 24, 2011 8:01 am
Forum: PHP - Code
Topic: updating a database with a loop/array/foreach ??
Replies: 1
Views: 180

updating a database with a loop/array/foreach ??

I can get the info from the database fine with this: $sql2 = "SELECT id, 1, 2, 3, 4, 5, 6 FROM ratestable ORDER BY id ASC"; $stmt2 = $db->prepare($sql2); $stmt2->execute(); $e2 = $stmt->fetch(); and display it with this: <?php while($e2 = $stmt2->fetch()) { ?> <input type="hidden"...