unexpected T_IF Issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

ghadacr wrote:I dont think that is helpful....
It would be.
No offense but in this case to change
echo $colour1 == $colour;
into
echo $colour1($colour);
shows an immense lack of understanding the basics of php.
And therefore: Please indent and format your code properly and take some basic php tutorials.
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post by ghadacr »

HAHAHAHAHA :lol: :lol: :lol: :lol:

Got it working without your help:

Cheers to my lack of understanding :evil:

A little tip Volka, please dont be so rude... People only come on to these boards for help, not more fights:!: :!:

Although i do give credit where it is due, and your skilled in PHP, but just be a little humane at times and not so confrontational....

Actually thats being a bit Hypercritical.... So i do apologise for that outburst just above....

Code: Select all

while ($row = mssql_fetch_array($result))
		
 { 
  	
  	$colour1="yellow";
  	$colour2="blue";

if($row['Confirmed' ] == 1)  { 
	echo $colour = $colour1;
	}

else{
	echo $colour = $colour2;
}
    	echo '<tr bgcolor='.  $colour .'>';
	
    	echo '<td>' . $row['HotelName' ] . '</td>'; 
	echo '<td>' . $row['RoomType' ] . '</td>'; 
	echo '<td>' . $row['AvailableFrom' ] . '</td>';
	echo '<td>' . $row['AvailableTo' ] . '</td>';
	echo '<td><input type="hidden" name="datefrom" value="' . $datefrom . '" />' . $datefrom .'</td>';
	echo '<td><input type="hidden" name="dateto" value="' . $dateto . '" />' . $dateto .'</td>';
	echo '<td>' . $row['Notes' ] . '</td>';
   
if  ($row['Confirmed' ] == 1)  { 
			echo '<td><a href="roomdetails.php?HotelRoomID=' . $row['HotelRoomID'] . '">This room has been confirmed, select for more information</a></td>';  } 
	else { 
		echo '<td><input type="checkbox" name="HotelRoomID[]" value="' . $row['HotelRoomID'] . '" />Select  ' . $row['RoomType'] .' to update</td>';	   
		} 

    echo '</tr>'; 
}
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

me beeing rude. rofl.
Believe me, you don't want me to be candid with you.
But lucky you, I will not insult you anymore because I have enough of it and will stay away from your threads. Good luck.
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post by ghadacr »

No volka, please come in to my threads, i do enjoy our discussions that we have... Makes the time fly by. I hope have not insulted you :( , come on volka! can we not make some friendly suggestions :?: :?: :?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Volka is possibly the most helpful member here. The only thing is that he'll give suggestions, and then the poster won't take them, and then wonders why nothing is working. Most of us would simply give up on you after you blatantly ignore our advice more than once, but volka keeps trying until you get it.

And I think the whole board agrees that basic tutorials will do you good. We don't really teach, we guide. Everything we say implies a basic understanding of the language, semantics, and mechanics.

I came here with a basic understanding, and being here has refined that into much more. Just learn some more, participate in the forums, and don't be so easily offended. We're all new at some point.
User avatar
ghadacr
Forum Contributor
Posts: 135
Joined: Fri May 11, 2007 10:44 am

Post by ghadacr »

Ok....Point taken
Post Reply