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?

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;


  
}
?>  

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.