lqdmindz Posted June 24, 2010 Share Posted June 24, 2010 hey guys, I am a total noob and appologies for this next question, but i was wondering how you could, with php, assign a value of 1 to a field in the mysql database. Then what sort of code would i need to read the field and if value = 1 then display an image. The context in which i wish to use it: I have a phpbb and the global announce feature doesnt stand out enough for me so im keen on having a mod that displays an image to the user that says 'New Announcment' and on clicking the announcement the value := 0 and they cant see it anymore. Any help would be great. Also, how would one := all users a 1 value and then on click just assign the individuals field a 0 value. lqd h1vem1nd.org Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/ Share on other sites More sharing options...
fenway Posted June 24, 2010 Share Posted June 24, 2010 Sounds like you need to get your hands on a good tutorial. Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076387 Share on other sites More sharing options...
lqdmindz Posted June 24, 2010 Author Share Posted June 24, 2010 I found one that searched to see if the variable was what was specified and an image could be displayed. But im guessing from that answer im going to have to keep searching? Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076401 Share on other sites More sharing options...
fenway Posted June 24, 2010 Share Posted June 24, 2010 Sorry, I don't follow. Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076413 Share on other sites More sharing options...
lqdmindz Posted June 24, 2010 Author Share Posted June 24, 2010 Am i going to have to find the help myself? Or could you possible suggest something useful like what to look for or what the commands might be called. Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076428 Share on other sites More sharing options...
fenway Posted June 24, 2010 Share Posted June 24, 2010 You're going to have to figure out how to explain the actual problem, or I won't be able to suggest anything. Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076627 Share on other sites More sharing options...
thewooleymammoth Posted June 24, 2010 Share Posted June 24, 2010 <?php /********************************************** first part**************************************** learn code to insert and extract info from a database****** **********************************************/ //$v = value from entry in database if($v == 1) { ?> <img ='images/your image' /> <?php } ?> I think you need to look up some basic php & mysql before you could attempt to make something like this Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076723 Share on other sites More sharing options...
lqdmindz Posted June 24, 2010 Author Share Posted June 24, 2010 Thanks wooly i will do Quote Link to comment https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076951 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.