Jump to content

syntax question


sinista

Recommended Posts

just been looking at some code

 

<?php
function updateStuff() {
    DB::query('LOCK TABLES `a`, `b`, `c` WRITE');
    /* some SQL Operations */
    someFunction();
    /* more SQL Operations */
    DB::query('UNLOCK TABLES');
} ?>

 

my question is what does DB::query do?

Link to comment
Share on other sites

:: is the scope operator. As RussellReal said, it's used for calling static methods. Which basically means the method belongs to the class itself, rather than an instance of it. Depending on how high your error reporting is set you may not get an error when trying to access a non-static method using the scope operator, so be careful.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.