Scott D wrote:
> Anyone know how to solve this? I am passing a URL variable to another
> page, the variable is the result of an SQL query. The results of the
> query can be multiple words seperated by a space, the variable though
> is only passing the first word of the result to the target page. Any
> ideas?
>
> Here is the code
> $query = "SELECT * FROM location";
> $result = mysql_query($query)
> or die ("Couldnt execute Query.");
>
>
> while ($info = mysql_fetch_array($result))
> {
> extract ($info);
> echo "<a href=test.php?varName=$headquarters_name>$headquar ters_name<br></a>";
echo '<a href=test.php?varName=', urlencode($headquarters_name), '>',
$headquarters_name, '<br></a>';
> }
>
> My Target page will only print the first word of the result string,
> and I need the full string.
Then in the target page:
echo urldecode($_GET['varName']);

HTH

--
Justin Koivisto - [email]spam@koivi.com[/email]
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.