I have a SQL query statement that will return a particular set of result. Such as ID, Names, Price. I have no problem with that.将取数组放入<a href> value in PHP
However i am trying to add a link within the echo loop and set ID as the value so that i can post it to another page. Would that be possible ?
while ($row = mysql_fetch_array($result)) {
echo
"".$row{'Url'}."<br>";
echo
"Name:".$row{'Name'}."<br>";
echo
"Price: $ ".$row{'Price'}."<br>";
echo
'<div class = "qwerty" data-countdown= '.$row{'Time'}.'></div>';
echo
"Location:".$row{'Location'}."<br>";
echo
"Description:".$row{'Description'}."<br>";
echo ''.$row{'ID'}.'';
echo '<a href="" onclick="jsScript()">Show Comments</a>
<form id="displayComments" style="display:none" target="jsScript()" method="post">
<input type="hidden" name="run" value=".$row{'ID'}." />
</form>';
您知道在php中可以通过$ arrayName [$ key]访问数组内容吗? – mleko
不是。我没有意识到。感谢分享,我也会检查一下。 –