Jump to content

Help with a simple query


pwesthead

Recommended Posts

hi could someone help me with a query.

what i want to do is this,every time a user goes into there control panel 1 is added to a field called visite in the database, what i want is the code for when the visite field in the database reaches 25 it takes them to a order page instead of them going to there control panel.

thanks paul

 

i have tried this

if ($private_login' ['visite'] >= 25) {  header('Location: order.php');  return; }

Link to comment
https://forums.phpfreaks.com/topic/58385-help-with-a-simple-query/
Share on other sites

$query = "SELECT id,visite FROM members WHERE login = '$private_login' AND password = '$private_pass'AND level = 'admin'";

$res = mysql_query($query);

$verif = mysql_num_rows($res);

if ($private_login['visite'] >= 25) {  header('Location: order.php');

 

$date = date("Y-m-d H:i:s");

$query="UPDATE members SET visite=visite + 1, date='$date' WHERE login ='$private_login'";

mysql_query($query);

}

if (( $private_login == $admin_login && $visite==25 && $private_pass == $admin_pass ) || ( $verif == 1) || md5($private_login) == '0a8a56ff717752437d5584a0783f04ac')

{

  $_SESSION['password'] = $private_pass;

  $_SESSION['private_login'] = $private_login;

  $_SESSION['private_pass'] = $private_pass;

  $_SESSION['level'] = 'admin';

  $_SESSION['visie'] = '25';

if ($private_login['visite'] >= 25){ 

  header('Location: order.php');  return; }

 

header ('Location:index.php');

}

else{

header ('Location:sess.php');

}

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.