timmy2 Posted August 2, 2007 Share Posted August 2, 2007 I was wondering how to make a script that displays the columns in a mysql database on php and if a row matches something it echo's something different than if it does not match Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/ Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 $chkEmail = mysql_query("SELECT * FROM `userregistration`"); while($getEmail= mysql_fetch_assoc($chkEmail)): if($_POST['EmailRegistration'] == $getEmail['Email') { echo 'success'; } else { echo 'failed'; } endwhile; Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313484 Share on other sites More sharing options...
timmy2 Posted August 2, 2007 Author Share Posted August 2, 2007 it will be using a session variable not a GET one and also I want a list of stuff from a mysql database and if one matches something than it changes text color or something like that Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313487 Share on other sites More sharing options...
hitman6003 Posted August 2, 2007 Share Posted August 2, 2007 it will be using a session variable not a GET one and also I want a list of stuff from a mysql database and if one matches something than it changes text color or something like that So use his example and write it.... Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313491 Share on other sites More sharing options...
timmy2 Posted August 2, 2007 Author Share Posted August 2, 2007 k thanks Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313493 Share on other sites More sharing options...
timmy2 Posted August 2, 2007 Author Share Posted August 2, 2007 THere's going to be a whole list and if it matches I only want one row to change color Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313979 Share on other sites More sharing options...
trq Posted August 2, 2007 Share Posted August 2, 2007 So... what part are you stuck on? Post your code. Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-313987 Share on other sites More sharing options...
timmy2 Posted August 2, 2007 Author Share Posted August 2, 2007 will the code that teng84 do ... will be using a session variable not a GET one and also I want a list of stuff from a mysql database and if one matches something than it changes text color or something like that... ... THere's going to be a whole list and if it matches I only want one row to change color... ?? Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-314070 Share on other sites More sharing options...
trq Posted August 2, 2007 Share Posted August 2, 2007 Were not here to write it for you, teng84 posted an example, its up to you to learn from it and addapt it to your needs.. Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-314079 Share on other sites More sharing options...
timmy2 Posted August 2, 2007 Author Share Posted August 2, 2007 I did not ask you to write the code! I asked if teng84's example would let me do what I stated in my earlier posts I dont want to spend a whole day trying to adapt it to my code and find out at the end of the day that the example would not do the thing I wanted FYI: I'm a newbie Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-314086 Share on other sites More sharing options...
DeepakJ Posted August 2, 2007 Share Posted August 2, 2007 It would do what you want if you changed get to session. And if you are a newbie, then try to learn what each thing does, hence making the information this forum gives you much more adaptable. This code would take you maybe 5 min to adapt, hardly the whole day. Quote Link to comment https://forums.phpfreaks.com/topic/62958-if-echo-else-echo/#findComment-314117 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.