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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.