PHP how to insert into MySQL database

Bro Code May 20, 2024
Video Thumbnail
Bro Code Logo

Bro Code

@brocodez

About

Coding bootcamps HATE HIM! 🗿

Video Description

#PHP #course #tutorial include("database.php"); $username = "Patrick"; $password = "rock3"; $hash = password_hash($password, PASSWORD_DEFAULT); $sql = "INSERT INTO users (user, password) VALUES ('$username', '$hash')"; try{ mysqli_query($conn, $sql); echo"User is now registered"; } catch(mysqli_sql_exception){ echo"Could not register user"; } mysqli_close($conn);

Boost Your Coding Setup

AI-recommended products based on this video

Loading...
AC600 Nano USB WiFi Adapter for Desktop PC/Laptop, Dual-Band (5GHz, 2.4GHz) Wireless 802.11ac MU-MIMO Network Adapter for Windows & Mac OS, Mini Travel Size WiFi Dongle

AC600 Nano USB WiFi Adapter for Desktop PC/Laptop, Dual-Band (5GHz, 2.4GHz) Wireless 802.11ac MU-MIMO Network Adapter for Windows & Mac OS, Mini Travel Size WiFi Dongle

(2)
$14.98
FREE delivery Sun, Jun 22 on your first order
Loading...
KEFEYA Portable Monitor for Laptop, P2 12” Full HD Dual Triple Monitor Laptop Screen Extender with IPS Display, HDMI/USB-A/Type-C Plug & Play for Cellphone, Windows, Chrome & Mac, Fits 13”-16” Laptops Global Recycled Standard

KEFEYA Portable Monitor for Laptop, P2 12” Full HD Dual Triple Monitor Laptop Screen Extender with IPS Display, HDMI/USB-A/Type-C Plug & Play for Cellphone, Windows, Chrome & Mac, Fits 13”-16” Laptops Global Recycled Standard

(796)
$189.99
Prime
Loading...
8Bitdo Wireless USB Adapter 2 for Switch, Windows, Mac & Steam Deck - Compatible With Xbox Series X & S, Xbox One Bluetooth, Switch Pro and PS5 Controllers (Black)

8Bitdo Wireless USB Adapter 2 for Switch, Windows, Mac & Steam Deck - Compatible With Xbox Series X & S, Xbox One Bluetooth, Switch Pro and PS5 Controllers (Black)

(5,446)
$26.99
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
GEEKOM A8 Mini PC (High Performance) – AMD Ryzen 7 8745HS, 16GB DDR4 Upgradable RAM + 1TB SSD, Mini Desktop for Gaming, Video Editing & Productivity, Windows 11 Pro, USB4, 8K/Quad Monitor Ready

GEEKOM A8 Mini PC (High Performance) – AMD Ryzen 7 8745HS, 16GB DDR4 Upgradable RAM + 1TB SSD, Mini Desktop for Gaming, Video Editing & Productivity, Windows 11 Pro, USB4, 8K/Quad Monitor Ready

(678)
$899.00
FREE delivery Sun, Jan 4
Loading...
Painted Book Mug, 3D Hand Painted Books Stack Shaped Coffee Cups, Book Lovers Coffee Mug, 11oz Novelty Painting Books Cups Gift for Readers, Librarians, Writers & Book Clubs

Painted Book Mug, 3D Hand Painted Books Stack Shaped Coffee Cups, Book Lovers Coffee Mug, 11oz Novelty Painting Books Cups Gift for Readers, Librarians, Writers & Book Clubs

(2)
$19.99
$6.99 delivery Jun 20 - 30
Loading...
10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

10.1 Inch Touch Portable Monitor IPS Screen 1366x768P 60Hz 400 Brightness 99% sRGB HDMI USB-C Monitors Switch for Xbox PS3/4/5 Laptop Compatible with Raspberry Pi, Mini Touch Screen

(1)
$99.99
FREE delivery Mon, Aug 11
Loading...
ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

ELECROW 8 Inch Portable Monitor, 1280x800 Mini HD Display with Built-in Speakers, USB Powered, Non-Touch LCD Screen for Raspberry Pi, PC, Laptop, Jetson Nano, Game Consoles

(49)
$117.29$102.21
$6.86 delivery Thu, Aug 14
Loading...
7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

7 Inch Portable Monitor Touchscreen HD 1024x600 LED Display Dual HDMI Port Small Monitor for PC Raspberry Pi Laptop Computer Xbox PS4/5 Switch Built-in Speakers

(61)
$68.99
FREE delivery Tue, Aug 12
Loading...
BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

BrosTrend 1800Mbps WiFi 6 Linux WiFi Adapter for PC and Raspberry Pi 2+, Long Range USB WiFi Dongle Linux for Ubuntu, Mint, Debian, Kubuntu, Lubuntu, Zorin, Windows 11/10, Dual Band Wireless Antenna

(288)
$54.14
FREE delivery Sun, Jun 22
Loading...
Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

Pishengfa DIY Stitch Book, Embroidery Stitch Book, DIY Sewing Books, EmbroideryS Books of Stitches, with 86/128 Sewing Tips for Beginners, Unique Embroidery Handmade Gifts (Grey)

(0)
$29.99
$6.99 delivery Dec 23, 2025 - Jan 2, 2026
700+ bought in past month
Loading...
LEGO City Mobile Police Dog Training 60369, SUV Toy Car with Trailer, Obstacle Course and Puppy Figures, Animal Playset for Boys and Girls Ages 5 Plus

LEGO City Mobile Police Dog Training 60369, SUV Toy Car with Trailer, Obstacle Course and Puppy Figures, Animal Playset for Boys and Girls Ages 5 Plus

(1,256)
$33.98
FREE delivery Sat, Jun 14 on your first order
200+ bought in past month
Loading...
Of Course It's Good!: Aggressively Delicious Meals ANYONE Can Make and EVERYONE Will Love

Of Course It's Good!: Aggressively Delicious Meals ANYONE Can Make and EVERYONE Will Love

(668)
$29.01
FREE delivery Mon, Feb 16 on your first order