Toy Posted September 29, 2010 Share Posted September 29, 2010 I have a simple question how would I do this? If a row in mysql i have "type" is set to "yes" do that stuff or if it's not do some other stuff Link to comment https://forums.phpfreaks.com/topic/214766-hey-guys/ Share on other sites More sharing options...
rondog Posted September 29, 2010 Share Posted September 29, 2010 that is just an if, else. How you know how to retrieve a row but dont know if else is hard to believe. Link to comment https://forums.phpfreaks.com/topic/214766-hey-guys/#findComment-1117347 Share on other sites More sharing options...
Toy Posted September 29, 2010 Author Share Posted September 29, 2010 that is just an if, else. How you know how to retrieve a row but dont know if else is hard to believe. what? anyways, i have two columns "id" and "type" i have randomized an "id" so what i want to do is check If type is = yes echo some stuff else echo some other stuff ? Link to comment https://forums.phpfreaks.com/topic/214766-hey-guys/#findComment-1117350 Share on other sites More sharing options...
Toy Posted September 29, 2010 Author Share Posted September 29, 2010 that is just an if, else. How you know how to retrieve a row but dont know if else is hard to believe. oh, it's not the if else part i'm having trouble with, it's the comparing of the column to match "YES" Link to comment https://forums.phpfreaks.com/topic/214766-hey-guys/#findComment-1117358 Share on other sites More sharing options...
rondog Posted September 29, 2010 Share Posted September 29, 2010 while ($row = mysql_fetch_array($query)) { if ($row['type'] == "yes") { //do something } else { //do something else } } Link to comment https://forums.phpfreaks.com/topic/214766-hey-guys/#findComment-1117359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.