Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Common PHP Mistakes Beginners often make
Search
Giorgi
February 05, 2016
Technology
46
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Common PHP Mistakes Beginners often make
Laravel Meetup Georgia 2016 #1 Speech
Giorgi
February 05, 2016
Transcript
8 slides
Common PHP Mistakes Beginners Often make
Using mysql extension 1 $c = mysql_connect("host", "user", "pass"); 2
mysql_select_db("db"); 3 $res = mysql_query("SELECT * FROM tb LIMIT 1"); 4 $row = mysql_fetch_assoc($result); 1 $mysqli = new mysqli("host", "user", "pass", "db"); 2 $res = $mysqli->query("SELECT * FROM tb LIMIT 1"); 3 $row = $res->fetch_assoc(); Deprecated! Secure Reliable Fast
Not Using PDO 1 $sth = $dbh->prepare 2 ('SELECT *
FROM fruit WHERE foo < ? AND bar = ?'); 3 $sth->execute(array(150, 'baz')); 4 $bazs = $sth -> fetchAll(); • Practical OOP Syntax • Support of PostgreSQL, MS SQL, etc. • Can Inject fetched data directly into a new object
Not Rewriting URLs https://stupidblog.org/post.php?id=1337 https://stupidblog.org/posts/1337/kardashyan-shit-again/ • SEO • User friendly
• Neat
@Suppressing errors Warning == Fatal Error @ == code might
suck but I just don’t care
Not validating User input, Sessions, Cookies 1 mysqli::real_escape_string ( $foo
); 2 htmlspecialchars( $bar );
“Screw this, I’m gonna use laravel”
Thanks! Contact me: Giorgi Bagdavadze
[email protected]
Other Decks in Technology
See All in Technology
Del vibe coding a un Desarrollo (agéntico) fiable
jcabot
0
160
DevOps Agentにあらゆるセキュリティインシデントのトリアージを任せた件
jirtosterone
1
180
おうち環境でも「なるべく止めたくない!」 ― おうち環境の機器冗長化の理想と現実
yuutosi
1
600
メール到達性を支える、リンク先URLのドメイン評価の扱い方
wind111
0
160
Go初心者のクラウドエンジニアが、デプロイを通して旨味を知っていく話
ryudai
1
240
Sonnetだけで業務はまわる?
kintotechdev
1
150
プロダクションコードにおける encoding/json から encoding/json/v2 へのスムーズな移行
sansantech
PRO
1
450
Datadog の権限統制 〜Org 統合に向けて調べた注意点 / JDDUG-Meetup_24
visional_engineering_and_design
1
180
会社説明資料_最新版
demaecan
0
32k
ラクスル会社紹介資料|エンジニア向け / RAKSUL Introduction for Engineers
raksulrecruiting
0
130
CloudTrail を推したい
kazzpapa3
1
140
変更差分を読むために環境を整備しよう
pipepasta
1
470
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
660
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Bash Introduction
62gerente
615
220k
Mind Mapping
helmedeiros
1
440
Mobile First: as difficult as doing things right
swwweet
225
10k
Navigating Weather and Climate Data
rabernat
0
590
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
RailsConf 2023
tenderlove
30
1.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Building Applications with DynamoDB
mza
96
7.3k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
First, design no harm
axbom
PRO
2
1.4k