Jump to content

need hel whit this please!


buladex

Recommended Posts

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1)
{
[color=red]	$sql="SELECT * FROM $tbl_name WHERE DATE_ADD`last_voted` (INTERVAL 12 HOUR) < NOW() and username='$myusername'";
    $result=mysql_query($sql);
    $count=mysql_num_rows($result);
    if($count==1)[/color]
     {
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
  mysql_query("UPDATE $tbl_name SET `vote_credits` = `vote_credits`+1 WHERE username='$myusername'");
  mysql_query("UPDATE $tbl_name SET `last_voted` = NOW() WHERE username='$myusername'");
  mysql_close($myconn);
  }
  else {
echo "12h";
}
}
else {
echo "Wrong Username or Password";
}

 

 

its a script that allowes ppl to vote on a 12 h interval, but i have a probleam it doesnt work, i think problem is where i write in red

Link to comment
https://forums.phpfreaks.com/topic/200150-need-hel-whit-this-please/
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.