getting a row value from an "id" column
<p>in the following code, i would like to get the row result for column "id" as a result for $selectedmovieid. The 'commenid' is the primary key attribute. Sorry for not knowing how to use mysql_fetch_assoc properly.</p>

<pre><code>&lt;?php
require ("connect-comment.php");
$deleteid=$_GET['commentid'];
$query1=mysql_query("SELECT id FROM comment WHERE commentid='$deleteid'");
$selectedmovieid= mysql_fetch_assoc($query1);
$query2=mysql_query("DELETE FROM comment WHERE commentid='$deleteid'");
header("Location: reload.php?id=$selectedmovieid");
?&gt;
</code></pre>

<p>EDIT 1: I will do up the security injection much later, just need to get the syntax right and get the right result. So this is what i have done so far:</p>

<pre><code>&lt;?php
require ("connect-comment.php");
$deleteid=$_GET['commentid'];
$query1=mysql_query("SELECT id FROM comment WHERE commentid='$deleteid'");
while ($selectedmovieid= mysql_fetch_assoc($query1))
{echo $selectedmovieid['id'];};
$query2=mysql_query("DELETE FROM comment WHERE commentid='$deleteid'");
header("Location: reload.php?id=$selectedmovieid");
?&gt;
</code></pre>

<p>Now this doesn't make much sense to me cos i am not parsing the correct <code>$selectedmovieid</code> value into the <code>reload.php?id=</code></p>
