Posts

Showing posts from May, 2019

Laravel: How does the query builder handle ->first()?

The  first()  method will always return one result or  null  if no results are found. Here's all it does: public function first ( $columns = array ( '*' )) { $results = $this -> take ( 1 )-> get ( $columns ); return count ( $results ) > 0 ? reset ( $results ) : null ; } The difference to just using  take(1)  (or  limit(1) ) is that it actually just returns one result object, by calling  reset() . (Also,  first()  obviously executes the query. The others don't)

Use '=' or LIKE to compare strings in SQL?

o see the performance difference, try this: SELECT count (*) FROM master .. sysobjects as A JOIN tempdb .. sysobjects as B on A . name = B . name SELECT count (*) FROM master .. sysobjects as A JOIN tempdb .. sysobjects as B on A . name LIKE B . name Comparing strings with '=' is much faster.

Clicks vs. Impressions?

Web terminology can be confusing, sometimes even to an experienced internet marketing professional. Most individuals that manage a dealership’s web presence are familiar with the difference between an Organic Optimization campaign and a Pay-Per-Click campaign. A smaller majority of those individuals are familiar with the difference between an ad  impression  and an ad  click . An ad  impression  is simply the number of times your ad, whether it’s a banner, button, or text link, has been (or will be) exposed to a potential viewer. In simple terms, this is the number of times that image appeared on any computer screen anywhere in the world. As an advertiser this is the least advantageous way to purchase advertising. Yes your ad is being viewed, but what is it really doing for you? A  click-through  is the actual number of times someone has taken their cursor, placed it on your advertising image and used their mouse to click on that image and be taken to your website. This is the mo