Page 1 of 1

Help Please!

Posted: Sat Mar 20, 2004 2:24 am
by apple

Code: Select all

<?php
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
		echo '<tr><td><a href=apple.php?id=$row[0]">';
		echo "<align="left">" . stripslashes($row[1]) . "</a></td>";
		echo "<td align="left">$row[2]</td>";
		echo "<td align="left">$row[3]</td>";
		echo "<td align="left">$row[4]</td>";
		echo "</tr>";
?>

How can I put $row[0] to the apple.php?

Thanks in Advance.

Posted: Sat Mar 20, 2004 3:02 am
by andre_c
I don't quite understand what you are trying to do, can you elaborate?

Posted: Sat Mar 20, 2004 6:00 am
by markl999
echo '<tr><td><a href="apple.php?id='.$row[0].'">';

Posted: Sat Mar 20, 2004 6:55 am
by m3mn0n
You pretty much had it right, maybe the problem is getting it from the URL?

How are you echoing/defining the variable $row[0] in the apple.php page?

Posted: Sat Mar 20, 2004 6:57 am
by markl999
The problem as i saw it was..
echo '<tr><td><a href=apple.php?id=$row[0]">';

The single quotes won't interpolate/evaluate $row[0] .. plus there's a stray " in there :o

Posted: Sat Mar 20, 2004 7:00 am
by m3mn0n
And that's why I don't program this early/late. ;)

I didn't catch that. heh

Apple, fix that parse error and see how things go.

Thanks

Posted: Sat Mar 20, 2004 9:43 am
by apple
:D Thanks! :lol:

Posted: Sun Mar 21, 2004 11:30 am
by doeboy
Instead of

echo '<tr><td><a href="apple.php?id='.$row[0].'">';

You could use {}

So

echo '<tr><td><a href="apple.php?id={$row[0]}">';

I would much rather do this than make sure I have the right amount/types of quotes.