YAY, I had a go myself and it works, but could do with a pointer (PHP)

Permabanned
Joined
22 Apr 2007
Posts
1,805
Ok gents, I've started getting to grips with this now.

I want to display two fields from a MySQL table on to the webpage, so I've done this

Code:
<?php

$address = "localhost";
$username = "root";
$password = "";
$database = "mark1e_dmd";

mysql_connect($address,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
    
$query = "SELECT p_title, p_summary FROM news";
$result = mysql_query($query)
or die("Query failed : " . mysql_error());

    
    print "<table border=1>\n";
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
        print "\t<tr>\n";
        foreach ($line as $col_value) {
            print "\t\t<td>$col_value</td>\n";
        }
        print "\t</tr>\n";
    }
    print "</table>\n";
    mysql_free_result($result);

    
mysql_close();
?>

That works great.

But what I want to do is provide a tick box (I guess) in the displayed table which if user clicks 'OK', 'Update' or whatever, drops that row from the table.

I'm not sure how to do this bit.

Thanks
 
Hah! Cool. I already have an id field in the table so every news article has an ID associated with it

I dont fully understand your $REQUEST bit though

Thanks so far
 
Back
Top Bottom