Jump to content

Recommended Posts

Posted

Using CubeCart's Database class, the statement would be:

Database::getInstance()->delete('CubeCart_sessions', array('location' => "~2022"));

The third parameter (false) is not necessary. It defaults to an empty string. That third parameter limits how many records get deleted.

Posted

I noticed that the location field is varbinary.

Is there anyway to match the above code to a varbinary field? I can't seem to get it to work.

Posted (edited)

I have no idea why 'location' is varbinary. CubeCart uses that column to store the web address used to access the site, including any querystring. Nothing in that textual string would require the table column to handle binary (that is, non-textual) data.

Let's review what you actually need to accomplish.

What is the nature of the content that is in the 'location' column that contains 2022?

 

Edited by bsmither
Posted

2022 was just an example.

I would like to weed out any sessions that I don't need to track.

cron jobs for example. I have a wget command running every 30 mins or so and cubecart creates a new session each time it runs.

So would it be ok for me to just change the field to varchar... it won't effect anything?

Posted

I would think you would have the same problem.

"I would like to weed out any sessions that I don't need to track."

Where are you tracking sessions? In admin, Statistics, Users Online tab? If so, is there a link above the table to Display Customers Only?

The database table CubeCart_sessions gets trimmed of records that are older than seven days.

 

Posted

Yeah, the users online tab. and I put a traffic chart on my dashboard. I will try converting that field to a varchar... see if that makes a difference.

Posted

If the traffic chart on the dashboard does not have a comparable way to limit the results to Customers Only, then perhaps your solution is to rewrite the custom code to add more to the WHERE clause:

AND `session_last` > `session_start`

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...