Re: [PHP] insert hyperlink to mysql query result

2001-08-22 Thread David Robley

On Thu, 23 Aug 2001 10:56, Andras Kende wrote:
> Hello,
>
> I have a mysql query with addresses , trying to insert a link to a map
>
> line 51
> echo " href=http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=$amyrow["addr
>ess"] &city1=$amyrow["city"]&stnm1=CA&zipc1=&cnty1=4>Map";
> echo "";
>
> Error Message:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING' in /home/sites/site15/web/salescomps.php on line 51
>
>
> I think its the  " character is the problem like :$amyrow["address"]
>
> Any help apprecciated,
> Thanks
>
> Andras

Yes. Normally you can escape with \" but in this case I think you will 
find that the array will not be parsed inside double quotes, so you need 
to concatenate the various parts of the string with .

Breaking your code down a bit to make it more easily understood:

echo '';
echo 'http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=';
echo $amyrow["address"] . '&city1=' . $amyrow["city"]';
echo '&stnm1=CA&zipc1=&cnty1=4">Map';
echo '';


-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   "It's only average," said Tom meanly.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] insert hyperlink to mysql query result

2001-08-22 Thread ReDucTor

echo "http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=".$amyrow["address
"]."
&city1=".$amyrow["city"]."&stnm1=CA&zipc1=&cnty1=4>Map";
echo "";
- Original Message -
From: "Andras Kende" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 23, 2001 11:26 AM
Subject: [PHP] insert hyperlink to mysql query result


> Hello,
>
> I have a mysql query with addresses , trying to insert a link to a map
>
> line 51
> echo "
href=http://www.expedia.com/pub/agent.dll?qscr=mcst&strt1=$amyrow["address";]
> &city1=$amyrow["city"]&stnm1=CA&zipc1=&cnty1=4>Map";
> echo "";
>
> Error Message:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING' in /home/sites/site15/web/salescomps.php on line 51
>
>
> I think its the  " character is the problem like :$amyrow["address"]
>
> Any help apprecciated,
> Thanks
>
> Andras
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]