Hi all,
Please help if you can> I am using the code below to link to another page and script.
<a href=\"accomodation/php/accomchoice.php?idname='<? echo urlencode($row["name"])."'>".$row["name"] ?></a>
This link pick up the contents of "$ROW" which is data that is not always the same i.e
the field could hold:
river bank hotel
claverdon hill hotel
Using the URLENCODE gives the link the following format:
http://www.mysite.com/accomodation/php/accomchoice.php?name=river+bank+hotel
When the link calls the script "ACCOMCHOICE.PHP" the following code is run:
LINE 84 $connection = mysql_connect($server, $user, $password);
LINE 85 mysql_select_db("db66511019", $connection);
LINE 86 $result = mysql_query("SELECT * FROM accom WHERE name = $idname" , $connection);
LINE 87 while ($row = mysql_fetch_array($result))
The system gives the following error:
Warning: Supplied argument is not a valid MySQL result resource in /homepages/41/d43000764/htdocs/TraveltoEngland/Accomodation/PHP/accomchoice.php on line 86
Any ideas as to why would be helpful.
Thanks in advance
DCJ