Delete SQL entries with php

Hi - I am using some software a guy I know did and I am cutting my teeth for PHP on it, so please excuse possible stupid questions.

i have a list of questions that users have asked. They are shown using the following file ‘edit_fq.php’ file location in the ‘view’ directory

[php]table class=“list”>


<?php echo getlocal("fqedit.question") ?>
<?php echo getlocal("fqedit.answer") ?>
<?php echo getlocal("fqedit.operator") ?>
<?php echo getlocal("fqedit.created") ?>
<?php echo getlocal("fqedit.updated") ?>

<?php $all_questions = get_featured_questions(); while ($question = mysql_fetch_assoc($all_questions)): ?>
<tr onclick="edit_question('<?php echo $question['id']?>');">
	<td><?php echo $question['question']?></td>
	<td><?php echo $question['answer']?></td>
	<td><?php echo $question['operator']?></td>
	<td><?php echo $question['created']?></td>
	<td><?php echo $question['updated']?></td>
	<td><a>remove</a></td>
</tr>
<?php endwhile;?> <?php>[/php] I then have a php file called the same in the operator folder: [php]<?php require_once('../libs/common.php'); require_once('../libs/operator.php'); require_once('../libs/settings.php'); $operator = check_login(); $link = connect(); function get_featured_questions(){ $getQuestions = mysql_query('SELECT a.id as id,a.question as question, a.answer as answer, a.created as created, a.updated as updated, b.vclogin as operator FROM featured_questions as a, chatoperator as b WHERE a.operator_id=b.operatorid',connect()); return $getQuestions; } prepare_menu($operator); setup_settings_tabs(3); start_html_output(); require('../view/edit_fq.php'); ?>[/php]

What I want to do is add an option to delete entries, where you can see the ‘remove’ a tag.

My SQL :

All these entries are stored in a ‘featured_questions’ table with the rows ‘id’, ‘question’, ‘answer’, ‘operator_id’, ‘created’, ‘updated’.

I realise this info is hard to put in an easy way, but if I can give any other details that would make it easier please let me know. I just really am desperate to know how to add this feature which would be a great learning step for me. Also any suggestions on how to add a notice of what entry has been deleted etc. Thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service