Adding fields to a log of member logins

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 18, 2014   (RSS)

Hey Jerry

I think you're missing the second variable in the prepared statement.

// CUSTOM CODE! add record to login_log
global $TABLE_PREFIX;
mysql_query(mysql_escapef("INSERT INTO {$TABLE_PREFIX}login_log SET createdDate = NOW(), who = ?, first = ?", $CURRENT_USER['num'], $CURRENT_USER['num']))
or die("Mysql error adding login_log record: ". htmlspecialchars(mysql_error()) . "\n")

It's probably breaking because it expects a second variable for 'first' in the statement and it's not getting it.

Does that help?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Thanks Claire,

I'll plug that in and report back.

It sure is easier to do things when you understand the language.

Best

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By gkornbluth - September 18, 2014 - edited: September 18, 2014

Thank you Claire,

That worked perfectly! (I expected no less...)

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php