|
Posted by Hemanth on 03/10/06 21:00
Ren wrote:
> 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'];
>
> $query = "SELECT * FROM dvd WHERE id = '$RID'";
> $result = mysql_query($query);
> 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.
>
> Thanks
> Slack
..........try this (change hostname, username, password, database_name
accordingly).
$RID = $_GET['recordID'];
$query = " SELECT * FROM dvd WHERE id = '$RID' ";
$dbcnx = @mysql_connect("localhost", "username", "password");
or die(mysql_error());
if (!@mysql_select_db("database_name", $dbcnx)) die(mysql_error());
if (!($result = @mysql_query($query, $dbcnx)) ) die(mysql_error());
while($row = @mysql_fetch_row($result))
{
echo $row['title'];
echo "<br>";
}
if(!(mysql_close($dbcnx))) die(mysql_error());
HTH,
Hemanth
Navigation:
[Reply to this message]
|