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 Quote Link to comment 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. Quote Link to comment 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 ? Quote Link to comment 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" Quote Link to comment 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 } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.