Forum Moderators: coopster

Message Too Old, No Replies

Create link from mysql search result

         

PartisanEntity

5:07 pm on Dec 6, 2009 (gmt 0)

10+ Year Member



Hi all,

I am trying to turn a mysql search result into a link that i can sent to a php script.

Is this possible:

while($rowOne = mysql_fetch_array($content))
{
echo '<a href="searchmultiple.php?SearchTerm='.$rowOne['term'].'&FromLanguage='.$FromLanguage.'&SearchID='$rowOne['id'].'">'.$rowOne['term'].'</a>';
}

I get the following error:

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /Applications/MAMP/htdocs/eilv/search.php on line 36

rocknbil

7:14 pm on Dec 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Missing a single concatenation operator. :-)

Not

SearchID='$rowOne['id'].'">'

but

SearchID='.$rowOne['id'].'">'

PartisanEntity

7:15 pm on Dec 6, 2009 (gmt 0)

10+ Year Member



Oh man, thanks so much, I have been trying to find the issue for the past two hours and never noticed. Gosh I feel like an idiot now :)

rocknbil

12:36 am on Dec 7, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LOL . . . don't. It's that whole staring at it forever thing. There are always problems with "pairs" in any language, paired quotes, paired concatenators, whatever, if you start looking for "pairs missing their counterpart" it gets easier.

Another thing that makes it easier (though I didn't cheat!) is a good editor. I use HomeSite, which supports multiple languages. For PHP, all the quoted stuff is green, functions blue, etc . . . really helps a lot if I see a whole block of what's supposed to be code in green.