Jump to content

dt_gry

Members
  • Posts

    52
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dt_gry's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi everyone, I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'primary WHERE (CustID) = '1121600984'' at line 1. when I am running this code, I have pored over this for about an hour and still cannot find where my syntax error is at. <?php include('config.php'); $Con = mysql_connect($Host, $Usr, $Pass); mysql_select_db("$DB", $Con); $PrefUsr = Usr; $Chk = "SELECT * FROM login WHERE Usr = '$PrefUsr'"; $Result = mysql_query($Chk) or die(mysql_error()); If (mysql_num_rows($Result)) { die("The Username that you entered is already in our system! Please try another."); } Else $CustID = rand(1, 9999999999); $MemStat = JJ; $testID = "SELECT * FROM primary WHERE (CustID) = '$CustID'"; $IDresult = mysql_query($testID) or die(mysql_error()); ; If (mysql_num_rows($IDresult)) { die("That Customer ID Already Exhists."); } Else $primary_insert = "INSERT INTO primary(CustID) VALUES('$_POST[$CustID]')"; $login_insert = "INSERT INTO login(CustID, Usr, Pass, MemStat, Email) VALUES('$_POST[$CustID]', '_$Post[usr]', '$_Post[Pass]', $_POST[$MemStat], '$_Post[Email])"; $basic_insert = "INSERT INTO basic(CustID, Fname, Lname, Ctry, St, City, Zip, CCAcct) Values('$_POST[$CustID]', '$_POST[Fname]', '$_POST[Lname]', '$_POST[Ctry]', '$_POST[st]', '$_POST[City]', '$_POST[Zip], '$_POST[CCAcct])"; If (mysql_query($primary_insert)) { die('Error: ' . mysql_error()); } echo "<br />Primary Key Generated and Inserted Successfuly<br />"; If (mysql_query($login_insert)) { die('Error: ' . mysql_error()); } echo "<br />Login Information Collected and Inserted Successfuly<br />"; If (mysql_query($basic_insert)) { die('Error: ' . mysql_error()); } echo "<br />Basic Information Collected and Inserted Successfuly<br />"; mysql_close($Con); ?> Thanks
  2. I am trying to store the last 4 digits of the credit card number that my customers use on my website. the field is set to 16 char. how would I store the last four digits into a $String_Var? Thanks
  3. but will that destroy everybodys session? Because I only want to destroy the users who have been logged on for 3 hours or greater. Thanks
  4. Okay my login script utilizes $_SESSION. I am wondering how I would terminate a session from the servers side, without user interaction (ie. selecting logout) Thanks
  5. Thanks Promiso I will try it. Thanks Again
  6. Okay that makes sense, but I also want to take those records and move them to an Activity_Log table. Not sure how to achieve this I have been reading up on it but still a little unclear. Thanks G!
  7. I thought I needed to load them into an array to test them, or would I just test each individual record and then the ones that the time logged in is greater than 60 I would move one at a time to the Activity_Log table? Thanks
  8. Okay so I am wanting to auto logout people from my system but I want to make sure I am thinking about this the right way. If I am going to check the length of time that a user has been logged in, I would have to take the time that I record in Active_Users mysql table subtract it from the current time and if it is greater than 60 then I would log them out. Correct? But I would have to load all the times in the DB table into an array if I am not mistaken. Thanks Guys!
  9. Thanks again rhodesa! Working on it now. XD
  10. Debian if I am not mistaken. Is there any sites that explain cron that you might suggest? Thanks
  11. Thanks rhodesa, that helps alot. Is cron jobs capable of calling scripts and executing them or would the cron job do all the work? Thanks Again!
  12. Hi guys, I have my login system setup, I have included the process at the end of this post. What I want to do is if the user has been logged in for X amount of time, I want to copy their info from Active_Users to Activity_Log and automaticley log them out. How would I achieve this? Login Process: the user logs in --> cookie is sent --> record is added to Active_Users table in the DB --> user is forwarded to members area. Logout Process: the user logsout --> record is coppied from Active_Users to Activity_Log --> record is deleted from Active_User --> user is forwarded to logout confirmation page. Thanks guys, any help is really appreciated!
  13. I am trying to setup 2 separate menus one for visitors and one for members, I have the site setup where everything is loaded on top of index.php so you have like index.php?section=home or index.php?section=login. I am wondering is it possible to do a test if the user is logged in and have that menu load via index.php based on a true/false answer. If anyone can point me in the right direction it would be great. Thanks guys. dt_gry
  14. Okay I solved my problem I had setcookie['mycookie'] and I needed setcookie['mycookie',['0',['/',['.mywebsite.com']]] Thanks guys. dt_gry
×
×
  • 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.