Jump to content

Assigning data


lqdmindz

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/205708-assigning-data/
Share on other sites

<?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

Link to comment
https://forums.phpfreaks.com/topic/205708-assigning-data/#findComment-1076723
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.