chrisj989 Posted July 6, 2006 Share Posted July 6, 2006 Hey Guys, first post here and I hope you can help me out with a few thingsI have a checkbox next to each field and what I want to do is allow users to select the rows through the checkboxes and the press an option button to delete the row. The checkboxes are inserted after every field.I'm also trying to insert data from a option field, doesn't seem to work.this is the option field and my attempt at inserting it: " <?php $query = "Select fA+' '+lA from tblA order by fA;"; $results = mssql_query($query); while ($row=mssql_fetch_row($results)) { echo"<option value=\"results\"> "; $fields = mssql_num_fields($results); for( $i = 0; $i < $fields; ++$i){ echo $row[$i]; } echo"</option>"; } ?> if(isset($_POST['addcomputer'])){ $FIELDINSERT = $_GET['results']; $pcq = "INSERT INTO tblB(id) VALUES('$FIELDINSERT')"; $add = mssql_query($pcq); } "My code is pretty crummy since this is my first time coding. Any and all help would be great, thanks!I'm using PHP with MS SQL 2000 by the way. Quote Link to comment https://forums.phpfreaks.com/topic/13860-couple-of-questions/ Share on other sites More sharing options...
wildteen88 Posted July 6, 2006 Share Posted July 6, 2006 For of change this:[code]while ($row=mssql_fetch_row($results)) { echo"<option value=\"results\"> "; $fields = mssql_num_fields($results); for( $i = 0; $i < $fields; ++$i){ echo $row[$i]; } echo"</option>"; } ?>[/code]to this instead:[code]$i = 0;while ($row = mssql_fetch_row($results)){ echo '<option value="results">'; echo $row[$i]; echo '</option>'; $i++;}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13860-couple-of-questions/#findComment-53972 Share on other sites More sharing options...
chrisj989 Posted July 6, 2006 Author Share Posted July 6, 2006 okie dokie, will doEDIT: Tried that, and it didn't work, only first entry showed up with a bunch of blanks after that Quote Link to comment https://forums.phpfreaks.com/topic/13860-couple-of-questions/#findComment-54013 Share on other sites More sharing options...
chrisj989 Posted July 7, 2006 Author Share Posted July 7, 2006 any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/13860-couple-of-questions/#findComment-54519 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.