Delaran Posted April 25, 2007 Share Posted April 25, 2007 Hey guys. Sorry to keep posting so many questions but this forum has extremely talented people in it that seem to know what they're doing. So here's the idea that I have: I've just queried a database to bring back everything. Every row and column is visible, and I've added another row after the real data that just consists of an X. Now, with this X I would like to make the entry disappear to the left it represents. Is there a way to do this or would it require $_POST, $_GET, or $_REQUEST functions? // if rows exist if (sqlite_num_rows($result) > 0) { // get each row as an array // print values echo "<table cellpadding=10 border=1>"; while($row = sqlite_fetch_array($result)) { echo "<tr>"; echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; echo "<td>".$row[3]."</td>"; echo "<td>".$row[4]."</td>"; echo "<td><a href=\"deletequery.php?entrynumber=$row[0]\">X</a></td>"; echo "</tr>"; } echo "</table>"; I've got this table so far Quote Link to comment https://forums.phpfreaks.com/topic/48690-queried-return/ Share on other sites More sharing options...
MadTechie Posted April 25, 2007 Share Posted April 25, 2007 do you mean update with out refresh ? if so AJAX or iframes if not what do you mean I would like to make the entry disappear to the left it represents Quote Link to comment https://forums.phpfreaks.com/topic/48690-queried-return/#findComment-238521 Share on other sites More sharing options...
sw0o0sh Posted April 25, 2007 Share Posted April 25, 2007 Well your link is clearly a get method. Simply make the page deletequery.php do the DELETE FROM bla_bla WHERE bla_bla = ' " . $_GET['entrynumber'] . " ' and then header('Location: wherever.php') to bring them back to the updated page (now that a row is deleted). however if you want it on instant, like he said above, use AJAX, or iframes to at least make it appear like they are not refreshing the page. Quote Link to comment https://forums.phpfreaks.com/topic/48690-queried-return/#findComment-238524 Share on other sites More sharing options...
Wildbug Posted April 25, 2007 Share Posted April 25, 2007 Make this smaller: echo "<td>".$row[0]."</td>"; echo "<td>".$row[1]."</td>"; echo "<td>".$row[2]."</td>"; echo "<td>".$row[3]."</td>"; echo "<td>".$row[4]."</td>"; // ... by doing this... foreach ($row as $r) echo "<td>$r</td>"; That won't solve anything, but it takes less typing. As for your actual question, I really don't understand what you mean right around the same part as MadTechie is confused. Can you elucidate? Quote Link to comment https://forums.phpfreaks.com/topic/48690-queried-return/#findComment-238530 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.