Posted by Johannes Wienke on 03/10/06 22:32
Am 10.03.2006 19:36 schrieb Ren:
> Thanks for the quick reply.
>
> It sounds easy from what you have stated but I still can't seem to get it to
> work.
>
> I think it may be something to do with my select statement. Here is a
> sample of the code.
>
> $RID = $_GET['recordID'];
For security-resasons this should be
mysql_real_escape_string($_GET['recordID']) if magic_quotes isn't active
(depending on your system).
> $query = "SELECT * FROM dvd WHERE id = '$RID'";
> $result = mysql_query($query);
mysql_qery() won't give you any printable result. You have to use
functions like mysql_fetch_assoc() or mysql_fetch_array().
> print ("$result[title]");
>
> Just to let you know that the table is called 'dvd' and 'id' and 'title' are
> column names in my table.
>
> I am just trying to display the 'title' of the selected record.
Take a look at http://php.net/mysql_fetch_assoc There are examples how
to do this.
[Back to original message]
|