Help adding a delete button per row on my table.

Sorry if this is common topic but I am getting to a point where I have tried a bunch of stuff and nothing seems to be working the way I would want it to.

Here is the code I am working with.

[php]

th,td{ border-width:0px 1px 1px 0px; } <?php mysql_connect('localhost','***','***') or die(mysql_error()); mysql_select_db('***') or die(mysql_error()); $query=mysql_query("select * from classlist limit 0,10") or die(mysql_error()); echo''; while($res=mysql_fetch_array($query)) { echo' '; } echo'
Class Id Class Title Instructor(s) Grade Range Seats Available Description Other Info
'.$res['class_id'].' '.$res['cname'].' '.$res['iname'].' '.$res['graderange'].' '.$res['seatsaval'].' '.$res['classdesc'].' '.$res['other'].'
'; ?>

Add Class Delete Class

[/php]

Please disregard my current delete button.

I am thinking the clearest way to handle this is to add another row with a delete link.
but if you have a way to take user input that would work as well.
what ever you think works best.

Any help would be greatly appreciated.
Please let me know if you have any questions.

Download the PDO bumpbstart database in my signature. There is an example of how to do what you want. And for gawd sake, stop using obsolete mysql code. You need to use PDO or Mysqli.

Sponsor our Newsletter | Privacy Policy | Terms of Service