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

Read Gmail inbox resulting in 'Too many login failures' error
Share variable between active php processes
Need to parse php array in ajax success callback
Specific fields only via Laravel Collection?
Creating An extension installer for a cms using laravel 5.3
Process SQL return into JSON
Restrict Google Geocoding to only true country results
apache Error in `/usr/sbin/apache2': free(): invalid next size (fast)
PHP can't unlink file after fclose
How to remove black border of Youtube image
My code for my form wont link to mysql database
need to switch between class scopes
mysqli_num_rows does not work after giving parameters [duplicate]
PHP - Why do you need 'x' permissions on a directory to read file stats?
Mysqli Query: Search both columns for either value or combined
SQL update for specific user

Categories

HOME
amazon-web-services
knockout.js
opencart
blast
long-integer
transactions
devexpress
mousemove
dronekit-python
qooxdoo
greasemonkey
amp
spring-security-oauth2
siesta
lda
fasm
corona
reselect
cocos2d-android
maven-plugin
office-ui-fabric
xsl-fo
coroutine
salt-cloud
http-authentication
adminlte
coreldraw
candlestick-chart
function-points
tsung
basic-authentication
guice
es6-modules
progid
windows2012
series
netstat
stackpanel
sspi
extbase
sendinput
react-intl
intellij-lombok-plugin
django-static-precompiler
scala-breeze
uiautomatorviewer
amazon-elastic-beanstalk
glimpse
polymaps
maatwebsite-excel
researchkit
google-identity-toolkit
thread-exceptions
system.web.optimization
groovyfx
noclassdeffounderror
timestamping
frame-grab
mathnet
gravatar
voronoi
m4
auto-generate
mixins
libz
vdm-sl
clarion
fuseesb
scala-swing
innerhtml
python-curses
mathematical-expressions
vs-unit-testing-framework
tabris
csslint
property-injection
jms-serializer
assetic
code39
strcmp
grails-2.3
stty
django-facebook
sunstudio
bcdedit
django-filebrowser
multiple-dispatch
clrprofiler
telerik-ajax
jzmq
nsfont
kolite
winsxs
principles
word-automation

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App