Posts

Showing posts from 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

What is BLOB data type in MySQL?How do I convert from BLOB to TEXT in MySQL?

https://www.tutorialspoint.com/What-is-BLOB-data-type-in-MySQL https://stackoverflow.com/questions/948174/how-do-i-convert-from-blob-to-text-in-mysql

INSERT INTO Table from multiple tables Sql Query

https://stackoverflow.com/questions/13244489/insert-into-table-from-multiple-tables

Getting “Lock wait timeout exceeded; try restarting transaction” even though I'm not using a transaction

https://stackoverflow.com/questions/5836623/getting-lock-wait-timeout-exceeded-try-restarting-transaction-even-though-im When you are using a transaction, autocommit makes them automatically commit at the end of the statement rather than disabling them. What's actually going on is, since you are updating every record on the table, another thread is holding record lock  on some record taking long time. Thus your thread is being timed out. Further details of the incident can be checked out by running SHOW ENGINE INNODB STATUS after the event (in sql editor). A quiet test machine will be preferable for the procedure.

Rollback one migration

php artisan migrate:rollback --step=1

What does auto do in margin:0 auto?

https://stackoverflow.com/questions/3170772/what-does-auto-do-in-margin0-auto/3170774