<p>I have this code</p>

<pre><code>while($row = mysql_fetch_row($result))
{
echo '&lt;tr&gt;';
$pk = $row[0]['ARTICLE_NO'];

foreach($row as $key =&gt; $value)
{
echo '&lt;td&gt;&lt;a href="#" onclick="GetAuctionData(\''.$pk.'\')"&gt;' . $value . '&lt;/a&gt;&lt;/td&gt;';
}
</code></pre>

<p>which gets pk. pk is then passed on to the axjax part with this:</p>

<pre><code>function GetAuctionData(pk)
{
.....
var url="get_auction.php?"
url=url+"cmd=GetAuctionData&amp;pk="+pk;
</code></pre>

<p>And finally used in a separate php file with:</p>

<pre><code>$pk = $_GET["pk"];
$sql="SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk'";
</code></pre>

<p>the second php file works fine when using it by itself and passing parameters. Likewise there are no errors anywhere. The problem seems to be with passing or generating $pk, as the links in the output file result in $pk being incremednted by 2, eg 4, 6, 8 etc</p>

<p>I can not understand why this is happening.</p>

I don't think this does what you expect:
```
```
$pk = $row[0]['ARTICLE_NO'];
```
```
Try with:
```
```
$pk = $row['ARTICLE_NO'];
```
```