
mistypotato
Members-
Posts
29 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
mistypotato's Achievements

Newbie (1/5)
0
Reputation
-
<?php // ###################### Start process logout ####################### function process_logout() { global $vbulletin; // clear all cookies beginning with COOKIE_PREFIX $prefix_length = strlen(COOKIE_PREFIX); foreach ($_COOKIE AS $key => $val) { $index = strpos($key, COOKIE_PREFIX); if ($index == 0 AND $index !== false) { $key = substr($key, $prefix_length); if (trim($key) == '') { continue; } vbsetcookie($key, '', 1); } } if ($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['userid'] != -1) { // init user data manager $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT); $userdata->set_existing($vbulletin->userinfo); $userdata->set('lastactivity', TIMENOW - $vbulletin->options['cookietimeout']); $userdata->set('lastvisit', TIMENOW); $userdata->save(); //BEGIN Insert Data into history //print "userid is $userid"; //$rlemail = $vbulletin->db->query_first("SELECT email FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo['userid'] . ) or die(" rlemail error: $userid" . mysql_error()); mysql_connect("localhost","user","1234567") or die ("Unable to connect to MySQL server."); $rlemail = mysql_query("SELECT email FROM Myforum.user WHERE userid = " . $vbulletin->userinfo['userid'] . "") or die(" rlemail error: ".$vbulletin->userinfo['userid']. mysql_error()); $db = mysql_select_db("Mycustomers") or die ("Unable to select requested database."); $totalrows = mysql_num_rows($rlemail); //print "$totalrows"; //print "rlemail is $rlemail"; //$rlemail = "[email protected]"; $Update2 = mysql_query("UPDATE Mycustomers.customers SET lastforumvisit = Now() WHERE Email = '$rlemail'") or die(" Update2 Insert error:" . mysql_error()); // END Insert Data into history // make sure any other of this user's sessions are deleted (in case they ended up with more than one) $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE userid = " . $vbulletin->userinfo['userid']); } $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "session WHERE sessionhash = '" . $vbulletin->db->escape_string($vbulletin->session->vars['dbsessionhash']) . "'"); if ($vbulletin->session->created == true) { // if we just created a session on this page, there's no reason not to use it $newsession =& $vbulletin->session; } else { ?>
-
Sorry....just dont know HOW much to post. But, in the meantime, I looked at the SQL server logs and it looks like everything is working EXCEPT, it's substituting THIS for the value of the variable.... 'Resource id #22'
-
it says unexpected ';' This is direcltly above it.... $userdata->save(); //BEGIN Insert Data into history print "userid is $userid";
-
Is there an obvious reason why this is resulting in a blank page ? print "userid is $userid";
-
now all im getting is a completely white...blank page. no errors or anything
-
thanks forvever Still getting an error ??? Is there a way to have php pages display all debugging information? thx !
-
Hi, Been working on this way too long now and decided it was time to ask for help... Can you see the syntax error in this code? $rlemail = $vbulletin->db->query_first("SELECT email FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo['userid'] . ) or die(" rlemail error: $userid" . mysql_error()); Thanks
-
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
No worries. I'm first to admit I don't really know much about php but I'm trying and positive support would be appreciated. This is a very good place to get info. A lot of very nice people here. I don't even know how I would get the entire structure of the table here ?????? -
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
VOID, You are the best ! I'm amazed how easy you made that seem hehe Thanks again -
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
VOID... YOU sir / maam are a thinker !!!! That is exactly what was wrong ;-) I was simply supplying a customer number that did not exist. Thank you for your intelligent and useful reply ! (and pleasant I may add) hehe MANY thanks! -
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
?? That is the structure of that field. What difference does it make what the rest of the table's structure is? Your response makes absolutely no sense. There are two totally different table involved. I'm Updating One...Inserting into another, the only trouble is the UPDATE line which uses one field (voted) in the customers table Besides if you like chocolate, a chocolate teapot is a great thing -
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
TABLE CUSTOMERS voted Varchar(1) Binary Default value=NULL -
Is there anything wrong with MySQL UPDATE statement ?
mistypotato replied to mistypotato's topic in PHP Coding Help
it works properly on the first part so I assume its still available for the 2nd statement? I thought maybe the way I was writing 'Y' was wrong -
Hi, I have two MySQL statements. The first one works perfectly (Insert1) but the second (Update2) does not seem to update the table called boating.customers. Can you see why? mysql_connect("localhost","admin","123456") or die ("Unable to connect to MySQL server."); $db = mysql_select_db("boatingcustomers") or die ("Unable to select requested database."); $Insert1 = mysql_query("INSERT INTO boatingcustomers.ratingshistory (vote,userid,voteid,date,ip) values ('$vote_sent','$nncustid','$id_sent',Now(),'$ip_num')") or die("Insert error:" . mysql_error()); $Update2 = mysql_query("UPDATE boatingcustomers.customers SET voted='Y' WHERE Custnum='$nncustid'") or die("Insert error:" . mysql_error());
-
Really, thank you all for the fast help ! I had no idea I could get this resolved this evening...so quickly You've all made my night and especially you Generic. You guys really know this stuff ;-)