php


Get Value Of Table Field


I am using php to echo query results out to a table like so
echo '<table border="1">';
echo '<tr>';
echo ' <th bgcolor="#FFFFFF" >Team Name </th>';
echo ' <th bgcolor="#FFFFFF" >Player Name </th>';
echo ' <th bgcolor="#FFFFFF">Jersey Number </th>';
echo '</tr>';
while ($Row = mssql_fetch_assoc($result))
{
echo '<tr><td>' . $Row['Team Name'] . '</td><td>' . $Row['Player Name'] . '</td><td>' . $Row['Jersey Number'] . '</td></tr>';
}
echo '</table>';
};
I want Jersey Number to be a hyperlink which can read the value of Player Name and pass that to a php file to be used as a query parameter and pull data for that specific player when the page loads.
Sample data is like
Team Name --- Player Name --- Jersey Number
Red Bob Jones 12
Blue Jack Horner 14
So if you click on 14, the code would read Jack Horner and store it in a variable. How is this achieved with php/html?
EDIT
Something like this is what I am after...using one page to redirect to and passing in the player name to use as a parameter.
Brief explanation, set the hyperlink to a page called other.php, and pass in the as part of the QueryString the value of .$row['name']
I tried the below syntax, but it gives me a 500 error
echo "<td><a href='other.php?playername=".$row['Player Name']'>" . $row['Player Name'] . "</a></td>";
Exmaple: Your link is like this
www.mysite.com/example/item?TeamName=Red&PlayerName=Bob&Jersey=12
The function parse_str automatically transforms all query parameters into corresponding PHP variables. $_SERVER['QUERY_STRING'] contains the data.
parse_str($_SERVER['QUERY_STRING'], $myArray);
print_r($myArray);

Related Links

How could I customize Zend_Tool to provide my own skeleton/template?
Update Personal Details PHP Script
MySQL query fails sometimes when using Internet Explorer
Possible injection from date string Select query
REGEXP to convert any 3 chars or less word to wordVVV
regexp split string by commas and spaces, but ignore the inside quotes and parentheses
Convert PDF to JPG automatically on upload in Drupal
Submit a form and email it with PHP
Retrieve data from mysql by php to create flot graph
How to pass parameters to PHP template rendered with 'include'?
Proximity search with Google maps
How do you handle library dependencies during deployment using PHP?
Is it possible to send mail asycronously using PHP while giving user feedback on delivery?
utf-8 decoding problem in php
php make date with format mm-dd-yyyy
How do I include a php.ini file in another php.ini file?

Categories

HOME
google-chrome
magento2
powerbi
svn
matrix
focus
eclipse-plugin
yii
paypal-ipn
applescript
activex
activemq
ews
google-play-services
dependencies
google-search-console
mithril.js
specifications
sharepoint-online
port
clickable-image
yahoo
csrf
jquery-file-upload
django-rq
android-5.1.1-lollipop
boomi
psql
dashdb
perfino
chronicle-queue
beego
fstar
openbravo
android-service
acrobat
code-climate
bonita
dnsmasq
docx4j
directfb
xerces-c
macports
tidal-scheduler
right-click
utf
git-tfs
react-intl
ipp-protocol
music21
ssi
aws-kinesis-firehose
icecast
supertest
kendo-editor
dex
polymaps
business-rules
allegro
xcode6.4
django-testing
gcloud-node
between
jeasyui
jeditable
ioctl
m4
cortana
godeps
ambiguity
mixins
blockquote
vdm-sl
kognitio-wx2
google-hangouts
juttle
global-scope
otl
communicate
preorder
ivalueconverter
jomsocial
django-sites
infinite
mousemotionlistener
tnt4j
dynamic-rdlc-generation
flv
mongo-jackson-mapper
days
ofstream
oembed
itunes-sdk
gprof
live-wallpaper
arrow
sfinae
telerik-ajax
trialware
hardcode
fitch-proofs
mkannotation
uploading
asio
botnet
database-deadlocks
photo-management
nsconnection
cassini
jboss-mdb

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App