0

I have the following

$Do = "<td WIDTH=20 Bgcolor=<?php echo $row['PMStatus']?>><center><b><a href=\"/PMOrder.php?AssetNum=<?php echo $row['AssetNum']?>\"><?php echo $row['EquipName']?></a></td>";

The back slash isn't working. I tried double double quotes. I know this is trivial to most. Help please. I'm assuming this is a quick fix. Thanks in advance

azgold816
  • 1
  • 3
  • This is all wrong, where did you get these coding practices from? – GrumpyCrouton Sep 25 '17 at 18:22
  • you're erroring out right now but didn't check for it – Funk Forty Niner Sep 25 '17 at 18:22
  • There's no reason to `echo` anything inside a string, it'll just break. Concatenate it instead. – Qirel Sep 25 '17 at 18:22
  • If all you're looking for is a double-quotes fix, try: $Do = '
    ' . $row['EquipName'] . '
    '; But honestly, without some sort of context for this statement, I can't guarantee that this will work.
    – Michael W. Sep 25 '17 at 18:24
  • The quotes aren't the problem. All of this "nested PHP" is the problem. You have a variety of inconsistent `?>` and ` – David Sep 25 '17 at 18:24
  • Side note, you're also missing the closing tags for `
    ` and ``, and the `
    ` tag is deprecated. It would be better to style this with CSS instead.
    – Don't Panic Sep 25 '17 at 18:26
  • How is it all wrong I'm just asking how to get the quotes for > stored in the $Do – azgold816 Sep 25 '17 at 18:30
  • I didn't include all the code. As it is a case of $Do. figured if I can get the A href quotes fixed I can further the code. Thank you Don't Panic – azgold816 Sep 25 '17 at 18:32
  • @azgold816: What do you mean by "how to get the quotes"? Storing quotes in a quoted string is trivial, you just have to escape the quotes exactly as you already do. But that's not the problem you're actually facing here. To examine your problem more... How is it failing? Is there an error? – David Sep 25 '17 at 19:14

0 Answers0