got a parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

1.8k views Asked by At

Trying to get this solved i think it is with the quotes that is why i was trying to play with the back slash but it still not working.

the following line of code:

<a href='images/content/$row['image']' class='prettyPhoto zoom'></a> 
4

There are 4 answers

0
Ikong On

How about this?

echo "<a href='images/content/".$row['image']."' class='prettyPhoto zoom'></a>"
0
CodePuppet On

You're using single quotes inside single quotes.

Try removing the single quotes around "image". Like so:

<a href='images/content/$row[image]' class='prettyPhoto zoom'></a>

You can only use this if your echo statement is using double quotes.

1
Jay On

Printing PHP variable value in HTML like this:

<a href="images/content/<?php print $row['image']; ?>" class="prettyPhoto zoom"></a>
0
Padmanathan J On

Try this

<a href="images/content/<?php echo $row['image'];?>" class="prettyPhoto zoom"></a>