This is the code I have now:
<td align="center" valign="middle">
<?php
// IF the users tips match with the correct tip, echo correct, else wrong on table cell
if ($row['1g1']==$row['1w1']){
?>
<img src="../../images/tick-cross/Tick1.png" width="20" height="20" alt="Correct" border="0" />
<?
}
else
{
?>
<img src="../../images/tick-cross/Cross1.png" width="20" height="20" alt="Wrong" border="0" />
<?
}
?>
</td>
Basically, if 2 rows in the table are equal it inserts a image of a tick/check, if they arent it inserts an image of a cross.
if your confused view the table here
Ok so I want to make the numbers before the ‘g’ and the ‘w’ into variables because i would otherwise have to change them hundreds of times.
IN THE Line:
if ($row['1g1']==$row['1w1']){
I want to make it:if ($row['$VARIABLEg1']==$row['$VARIABLEw1']){
What is the correct syntax of doing this? its driving me insane!
The correct syntax is done by adding curly braces around the variable like so:
Btw, it only works inside double quotes.