Reply to Re: Display selected record that has been passed to URL

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация