Hi
I was wondering what is wrong with the following statement:
echo "<td>" . "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' . '</td>';
I cant see it.
Thanks for any help.
Shouldn't the first double quote here be matched by a closing double quote instead of a single one?
"<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'
Looks closed to me.
"<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>'
You have the closing tag for A and the start tag is closed properly too. Or do I miss something?
Above me, I'm afraid. You have to wait for Christian to wake up.
echo "<td>" . "<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. ">". 'Edit'.'</a>' . '</td>';
Looks awfully confused. Presumably this is "inside" php (i.e. preceded by a <? tag somewhere), so you have:
echo // this echoes the following string(s)
"<td>" // will echo <td>
. // is the string concatenation operator so it will now echo the next string, from the first " to to closing "
"<a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'. "
So far then you expect to get
<td><a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'.
I do not think this is what you mean. If you want to echo a bunch of text with just one bit of PHP in it, just switch off php except for the one bit:
?>
<td><a href='edit1.php?id=<?php echo $data['CustomersArtitemid']; ?>'>Edit</a></td>
I think that is what you mean; the php "short form" helps more with readability:
<td><a href='edit1.php?id=
<?=$data['CustomersArtitemid']?>'>Edit</a></td>
I think it is much simpler as far as possible to turn everything that is going to be echoed into a simple variable, like this:
$id = $data['CustomersArtitemid'];
echo "<td><a href=\"edit1.php?id=$id\">Edit</a></td>\n";
(If you use single quotes you don't have to escape them, but it's more conventional to use double quotes in html, I think.)
HTH
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)