Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // connect to the database
- mysql_connect(**********);
- // select the database
- mysql_select_db(****************) or die("Unable to select database");
- // run the query and put the results in an array variable called $result
- $result = mysql_query("SELECT * FROM Table");
- print "<form name='namestoupdate' method='post' action='update.php'>\n";
- ?>
- <table border="1" cellpadding="10" cellspacing="1" width="10" class="tblListForm">
- <tr class="listheader">
- <td>ID</td>
- <td>Prezime</td>
- <td>Ime</td>
- <td>JMBG</td>
- <td>Odeljenje</td>
- <td>Sektor</td>
- <td>Izbor</td>
- </tr>
- <?php
- $i=0;
- while ($books = mysql_fetch_array($result)) {
- if($i%2==0)
- $classname="evenRow";
- else
- $classname="oddRow";
- print "<input type='hidden' name='id[$i]' value='{$books['ID']}' />";
- ?>
- <tr class="<?php if(isset($classname)) echo $classname;?>">
- <td><?php echo $books["ID"]; ?></td>
- <td><?php echo $books["Prezime"]; ?></td>
- <td><?php echo $books["Ime"]; ?></td>
- <td><?php echo $books["JMBG"]; ?></td>
- <td><?php echo $books["Odeljenje"]; ?></td>
- <td><?php echo $books["Sektor"]; ?></td>
- <td><?php echo $books["Izbor"]; ?></td>
- <td>
- <?php
- print "<input type='text' size='40' name='bookinfo[$i]' value='{$books['Ime']}' />"; ?> // <- OVAJ DEO
- </td>
- </tr>
- <?php
- ++$i;
- }
- print "<input type='submit' value='submit' />";
- print "</form>";
- mysql_close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement