0

I need some help with a problem I'm doing.

It's simple.

I have this code.

while ($ row = mysql_fetch_array ($ resultadosql))
{

  echo ("<tr> <td>" $ row ["id"] "</ td>"..);
  echo ("<td> <a href='themedisplay.php?id=" $row["id"] "'> edit </a> </ td>..");

the second is a link in another column to another window to edit the inserted data.

What I want to change the link "edit" to variable id, in other words to put the last echo inside this.

echo ("<tr> <td>" $ row ["id"] "</ td>"..);

That the id showed is the link to the editing window.

Thanks for the help.

Arian Faurtosh
  • 17,987
  • 21
  • 77
  • 115
dax
  • 39
  • 1
  • 1
  • 6
  • To make the link open a new window (or tab), use the attribute target="_blank". – SebHallin Mar 07 '15 at 17:38
  • possible duplicate of [PHP - concatenate or directly insert variables in string](http://stackoverflow.com/questions/5605965/php-concatenate-or-directly-insert-variables-in-string) – David Foerster Mar 07 '15 at 17:59

1 Answers1

0

The code may have more errors (im assuming your post code formatting is alittle off) but here corrects the visible one:

Change these snippets to:

"<tr> <td>" . $row["id"] . "</ td>"

"<td> <a href='themedisplay.php?id=" . $row["id"] . "'> edit </a></td>"
NaN
  • 697
  • 5
  • 11
  • I think you didn't understand me. Let's see, i have a table with several columns, one that shows the variable $id , more and another it's just a link to a new window to edit the content of that selected. What i want to do is that just by clicking at the id's i can go to that edit window. – dax Mar 07 '15 at 17:40
  • @dax i think that you maybe right, try editing your question so its a little clearer – NaN Mar 07 '15 at 17:41