Jump to content

[SOLVED] adding 1 to a value each time something happens?


shadiadiph

Recommended Posts

I have a usertable which has a field timeslogged so how do i write it so that each time this is activated it updated has 1 added to it.?

 

$DB_site->query("UPDATE tbluserdetails set logged= 'Y', dtlogged='now()', timeslogged='????'   where username='$username'");

 

Also is there anyway to reset the value of a field every 24 hours automatically?

Link to comment
Share on other sites

mm this script isn't actually working if their is  apictur it still displays it but if there isn't it wont display anything in the else { section when i view the page directly showpic it gives me the error

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/hmtcompa/public_html/user/showpic3.php on line 6

 

if their is no image won't show anything even something simple.

 

<?php 
require("../global/admin_functions.php"); 

$query = "SELECT thumbnail4,thumbnailtype4 FROM zloads where intProductID=".$_GET['adid'];
$result = mysql_query($query);
  if (mysql_num_rows($result) > 0) {
  $data = mysql_result($result,0,"thumbnail4"); 
  $type = mysql_result($result,0,"thumbnailtype4"); 
  Header( "Content-type: $type");
  print $data; 
} 

else 
{


print hello;


  
}
?>  

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.