/    Sign up×
Community /Pin to ProfileBookmark

adding a sql retreived value to a ‘href’

Hey all,

I need to add a value which I am retrieving from a sql table to a ‘href’ link… if you check out my page, you’ll see exactly what I mean:

[url]www.paulclift.net/CC-MSM/trapani.php[/url]

On the right-hand side, under ‘Score:’ there are a bunch of links, which I am retrieving from a sql database. BUT I need to add the folder to the link for it to work. Here is the relevant section of the php code:

[COLOR=”DimGray”]

while($info = mysql_fetch_array( $data ))
{
Print ‘<tr height=”30px”> ‘;
Print ‘<td><a href=”media/?$info[score]”>’.$info[‘score’] . ‘</td></tr>’;
}

[/COLOR]

Does anyone know how to add this to the href address?

THANKS!

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@eval_BadCode_Dec 16.2010 — [code=php]
while($info = mysql_fetch_array( $data )) {
$score = $info['score'];
print<<<EOS
<tr height="30px">
<td>
<a href="media/$score">
$score
</a>
</td>
</tr>
EOS;

}
[/code]


By the way, the first one is missing the "f" in pdf.
Copy linkTweet thisAlerts:
@paulcliftauthorDec 16.2010 — eval(BadCode)


THANKS!
×

Success!

Help @paulclift spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...