Digital Fox
Digital Fox
  • Видео 68
  • Просмотров 734 201
PHP and PDO Database Connection | Creating Reusable Database Class
Welcome to this comprehensive tutorial where you'll learn how to create a reusable database class using PHP and PDO (PHP Data Objects).
This class will handle all your database operations like INSERT, UPDATE, DELETE, and SELECT with ease and efficiency.
📖 What You'll Learn in This Video:
- The fundamentals of PDO and why it’s essential for secure and efficient database interaction.
- How to use prepared statements to bind placeholders and values, ensuring database security.
- Writing a reusable database class with no dependencies other than an errors.log file.
- Logging SQL and connection errors to keep your application robust.
- How to make the class generic so you can use it with any project...
Просмотров: 233

Видео

Dynamic Drop Down Select Menu with PHP, MySQL and JavaScript
Просмотров 308Месяц назад
In this tutorial, you’ll learn how to create dynamic, database-driven select menus using PHP, JavaScript, and MySQL. We'll cover how to populate a dropdown menu with countries and dynamically fetch corresponding cities when a country is selected. 🗺️✨ What’s in the video? Setting up the project files: functions.php, script.js, and index.php. Overview of the MySQL database structure, including th...
Dynamic Drop Down Select Menus with JavaScript and JSON 🌟
Просмотров 245Месяц назад
In this tutorial, I’ll show you how easy it is to create dynamic dropdown menus using JavaScript and a JSON file. Watch as we populate a country dropdown menu and dynamically display the corresponding cities in a second menu based on user selection! What’s Covered in the Video: Overview of the countries.json file containing country-city data. Setting up the HTML structure with two dropdown menu...
How to Log Database Error Messages in a Log.txt File Using PHP and MySQL | PHP Tutorial
Просмотров 129Месяц назад
In this video, I’ll show you how to handle database error messages securely by logging them into a file instead of displaying them to users. This approach ensures sensitive MySQL data remains protected while maintaining good error-handling practices. Here’s what we’ll cover: Setting up the required files: log.txt and script.php. Writing a log-database-error function to save error messages with ...
Create Dynamic MySQL Table from HTML Form Using PHP
Просмотров 3052 месяца назад
In today’s video, I’ll show you how to create dynamic database tables using PHP and an HTML form. We’re making the process super simple and easy to follow. What You’ll Learn Setting up an HTML form where you can enter a table name and column names. Writing PHP code to: Handle the form data. Clean up the input to keep it secure. Build and run SQL queries dynamically. Using PHP functions like exp...
How to Convert Text File to JSON with PHP | PHP and JSON Tutorial
Просмотров 1402 месяца назад
In this video we are going to take the data from a text file and convert them to a JSON file. In the text file we have users stored as plain text. We are going to fetch the text data with PHP and convert them to objects and store them in a JSON file. In this tutorial we are going to work with the following functions. file_get_contents, trim, preg_split, foreach, explode, json_encode, file_put_c...
How to Display JSON Data Inside HTML Table with PHP | PHP and JSON Tutorial
Просмотров 3432 месяца назад
In today’s video, I’ll show you how simple it is to load data from a JSON file and display it inside an HTML table using PHP. Let's dive right in! What You’ll Learn How to fetch data from a JSON file. Using PHP to decode the JSON and display product details like image, name, price, product code, and inventory in a table. Adding basic styling to the table for a better look. What’s Inside the JSO...
How to Display MySQL Database Data in Chart.js Using PHP and JavaScript
Просмотров 1,1 тыс.2 месяца назад
In this tutorial, I’ll walk you through how to fetch data from a MySQL database table and display it dynamically in a chart using Chart.js. We'll cover everything step-by-step: ✅ Setting up the database table ✅ Writing the PHP script to fetch the data ✅ Using JavaScript to fetch and process the data ✅ Creating beautiful charts with Chart.js Whether you’re building bar charts, line charts, or an...
How to Save Form Data in a JSON File Using PHP | Store Messages in JSON File with PHP
Просмотров 8988 месяцев назад
In this tutorial we are going to use PHP to collect the data from a contact form and save the messages in a JSON file. Also we will have an inbox page to display, delete, or reply to a message. I am going to start the tutorial with a live example and then we are going to recreate the whole thing. This is a full stack tutorial so we will use HTML, CSS, PHP, and JavaScript to code the application...
How to Upload, Display, and Delete Images in a Database Using PHP and MySQL
Просмотров 1 тыс.11 месяцев назад
We're going to create a small application that allows us to upload image files to the server, store their names in a database, display the uploaded images in the browser, and provide us with the option to delete them. Also we will display errors to the user when something goes wrong. This is basic PHP and MySQL stuff that we need to know. If you feel like saying thanks, you can buy me a coffee ...
How to Drag and Drop images using JavaScript | JavaScript Tutorial
Просмотров 1,2 тыс.11 месяцев назад
In this tutorial, I am going to show you how to drag and drop image files from your computer into the browser and get an instant preview using only vanilla JavaScript. You are going to learn how to use the dragenter, the dragover , the dragleave, and the drop event listeners to drag the files into a designated drop-area and handle them. Also you will learn how to use the dataTransfer object to ...
How to properly validate an uploaded image file using PHP | PHP file Validation tutorial
Просмотров 1,6 тыс.Год назад
In this video i m going to show you how to be sure, that the uploaded file is an image. We are going to properly validate an uploaded image using php. The code that we are going to write can easily used in a live project. We are going to check if the file is a real image, and not something else like a pdf, or text file, or some malicious script file that someone has changed the file-extension t...
Create Dynamic Charts with JSON, JavaScript, and Chart.js
Просмотров 15 тыс.Год назад
In this tutorial, learn how to fetch data from a JSON file and display it in interactive charts using Chart.js and JavaScript. Plus, discover how to switch between chart types dynamically with just a click of a button! 🚀 🎥 What You'll Learn: ✅ Setting up Chart.js with HTML and JavaScript ✅ Fetching and mapping JSON data into charts ✅ Customizing chart labels, data points, and responsiveness ✅ S...
Send Email from localhost with PHP using PHPMailer and Gmail SMTP server | Working contact Form
Просмотров 35 тыс.Год назад
In this tutorial, I’ll show you how to use the PHPMailer library and Gmail's SMTP server to send emails in PHP. Whether you’re building a contact form or a mailing feature, this step-by-step guide covers everything you need to get started. 🎥 What You'll Learn: ✅ Setting up PHPMailer and integrating it into your project ✅ Creating a Gmail app password for secure email sending ✅ Validating form i...
Creating dynamic web pages using PHP and MySQL | Part 2 | Coding the back-end
Просмотров 9 тыс.Год назад
In today's Tutorial we will see how to create dynamic content using php and mysql. This is the second part of a two-part tutorial. In the first part we created the front-end of a simple shop, and in this part we will create the dynamic content using php and mysql. We are going to create a simple shop , and we are going to create it from scratch. Download the products folder and the database tab...
Creating Dynamic Web Pages Using PHP and MySQL | Part 1 | Coding the Front-end
Просмотров 25 тыс.Год назад
Creating Dynamic Web Pages Using PHP and MySQL | Part 1 | Coding the Front-end
Upload Multiple Files with PHP | PHP tutorial
Просмотров 12 тыс.Год назад
Upload Multiple Files with PHP | PHP tutorial
Using JavaScript to upload a file without using a form | JavaScript and Ajax Tutorial
Просмотров 1,8 тыс.Год назад
Using JavaScript to upload a file without using a form | JavaScript and Ajax Tutorial
Creating a Simple Pagination Using PHP and MySQL
Просмотров 30 тыс.Год назад
Creating a Simple Pagination Using PHP and MySQL
How to loop through arrays and display html code inside paragraphs and tables with php.
Просмотров 4 тыс.Год назад
How to loop through arrays and display html code inside paragraphs and tables with php.
How to Send a JavaScript Object to a PHP File Using the Fetch Method
Просмотров 32 тыс.2 года назад
How to Send a JavaScript Object to a PHP File Using the Fetch Method
Creating the Front-end of a Five Star Rating System with JavaScript, HTML, and CSS.
Просмотров 7 тыс.2 года назад
Creating the Front-end of a Five Star Rating System with JavaScript, HTML, and CSS.
How to create a page scroll progress bar indicator with javascript
Просмотров 2,5 тыс.2 года назад
How to create a page scroll progress bar indicator with javascript
How to create, generate, strong random passwords with PHP | PHP Tutorial
Просмотров 1,7 тыс.2 года назад
How to create, generate, strong random passwords with PHP | PHP Tutorial
How to create a password strength checker with JavaScript | Strong password checker
Просмотров 2 тыс.2 года назад
How to create a password strength checker with JavaScript | Strong password checker
Secure login, register system with PHP and MySQL | Part 3 - Reset Forgot Password
Просмотров 3 тыс.2 года назад
Secure login, register system with PHP and MySQL | Part 3 - Reset Forgot Password
Secure login, register system with PHP and MySQL | Part 2 - Login Form
Просмотров 5 тыс.2 года назад
Secure login, register system with PHP and MySQL | Part 2 - Login Form
Secure login, register system with PHP and MySQL | Part 1 - Register Form
Просмотров 17 тыс.2 года назад
Secure login, register system with PHP and MySQL | Part 1 - Register Form
How to create, write, read, and delete files in php | PHP filesystem tutorial.
Просмотров 5 тыс.2 года назад
How to create, write, read, and delete files in php | PHP filesystem tutorial.
How to toggle a click event in javascript | Toggle a mouse click
Просмотров 7 тыс.2 года назад
How to toggle a click event in javascript | Toggle a mouse click

Комментарии

  • @rasbry225
    @rasbry225 9 дней назад

    Good day sir, I have a error said., Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\send-html-mail-with-php\script.php on line 20 There was an error

  • @marcoangeli5476
    @marcoangeli5476 25 дней назад

    Same process getting JSON fron an URL?

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 17 дней назад

      Yes but, the URL provided in the fetch method should be accessible, and CORS (Cross-Origin Resource Sharing) must be enabled on the server if you are fetching data from a different domain.

  • @zeynepuzunbas
    @zeynepuzunbas 27 дней назад

    How to add dynamic populate 3 select menus and 1 input

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 17 дней назад

      It's a little bit more complicated. I will try to make a video on it.

  • @tutanchacon
    @tutanchacon 28 дней назад

    Excelent! Tank you for sharing

  • @phoneandroid6845
    @phoneandroid6845 28 дней назад

    How to do multiple chart on the same page using this method?

  • @LopobicWyn
    @LopobicWyn 29 дней назад

    Super sir!🙏

  • @phoneandroid6845
    @phoneandroid6845 29 дней назад

    Thanks, the video is awesome👍

  • @vladbp_yyz
    @vladbp_yyz Месяц назад

    didn't work. I create several PDF files by clicking a button and then try to zip them all and the zip file is not created. Inside the Downloads folder I create another folder por each costumer ID. Downloads/1/, Downloads/2/,Downloads/35/... etc. The PDFs are created inside the costumer ID folder. The content of those folders is what I'm trying to compress unsuccessfully.

  • @DigitalFox-tutorials
    @DigitalFox-tutorials Месяц назад

    Hi everyone tell me what you think. Is everything understandable?

  • @NedumEze
    @NedumEze Месяц назад

    Digifox my favorite Teacher. Thank you sir.

  • @soundjuggler129
    @soundjuggler129 Месяц назад

    great video showing how to start with chart js thank you

  • @alalyrealestate1136
    @alalyrealestate1136 Месяц назад

    very good

  • @AbdulRohmanilmukuduniaku
    @AbdulRohmanilmukuduniaku Месяц назад

    2024 , thanks bro

  • @priyadarshnipatil4609
    @priyadarshnipatil4609 Месяц назад

    Can you make a video about the database you have created.

  • @tiagoborges5108
    @tiagoborges5108 Месяц назад

    I just have a word to describe this video," FANTASTIC" .

  • @solomonndegwa9951
    @solomonndegwa9951 Месяц назад

    Awesome

  • @Pixelyze-tech
    @Pixelyze-tech Месяц назад

    The last example, would that not be GET method instead of POST method, bit confused. As POST method is to send and GET is to receive

    • @infinitespace1982
      @infinitespace1982 8 дней назад

      I think you can use this example as a start to pass any set of parameters via post to a php script, which will then process the parameters and then return a response back.

  • @DigitalFox-tutorials
    @DigitalFox-tutorials Месяц назад

    Hi guys. Is everything understandable?

  • @tiagoborges5108
    @tiagoborges5108 Месяц назад

    Very interesting video and thank you fot the video, but i have a question, how can we do it but with data that comes from a database.

  • @theodoremasi5313
    @theodoremasi5313 Месяц назад

    Thanks so much! My issue was the length of the passwords in my DB

  • @swapnilsalunkhe5485
    @swapnilsalunkhe5485 Месяц назад

    Hi, I have dynamic data which changes according to user query how can i visualize that data into different charts.

  • @tkar66
    @tkar66 Месяц назад

    Awesome, you made PHP and MySQL look so simple.

  • @tkar66
    @tkar66 Месяц назад

    YoYuAwesybb

  • @swtiriasioziou
    @swtiriasioziou Месяц назад

    how to send email in localhost

    • @DigitalFox-tutorials
      @DigitalFox-tutorials Месяц назад

      Hey, check this video : ruclips.net/video/fSfNTACbplA/видео.html

  • @DigitalFox-tutorials
    @DigitalFox-tutorials Месяц назад

    Hi guys. Tell me what you think. Is everything understandable?

  • @zaifhossain8509
    @zaifhossain8509 2 месяца назад

    You're back again 👌👍

  • @lilbonita22404
    @lilbonita22404 2 месяца назад

    Thank you so much i really need this tuto❤

  • @tkar66
    @tkar66 2 месяца назад

    Thank you. it is very clear, however if the field is numeric, there is a problem.

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 2 месяца назад

      Yes I know, I just wanted to show you how to structure an SQL query dynamically. If we want to add also the type of the columns we have to construct the form in a different way. Glad you liked it.

  • @sportnastava
    @sportnastava 2 месяца назад

    I like your tutorials, would love to see them with pdo in future 😊

  • @DigitalFox-tutorials
    @DigitalFox-tutorials 2 месяца назад

    Hi guys and girls tell me what you think, is everything understandable. If you have any questions feel free to ask. I always try to answer them. Also if you have any tutorial ideas about a topic that you struggle with, let me know in the comments. Thanks for watching.

  • @NedumEze
    @NedumEze 2 месяца назад

    But, sir, the file_get_contents () is often disabled in most Production Servers. Does it work for you in your Production Server? Is there any other way of doing this which should have universal acceptance?

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 2 месяца назад

      You're correct; file_get_contents() is often disabled on many production servers due to security concerns when fetching remote files. But there is no problem to fetch local files. Ensure the directive 'allow_url_fopen' in the php.ini file, is set to 'On'. allow_url_fopen = On If you want to fetch remote files you can use 'cURL' instead.

    • @NedumEze
      @NedumEze 2 месяца назад

      @DigitalFox-tutorials Thank you sir for everything.

  • @DigitalFox-tutorials
    @DigitalFox-tutorials 2 месяца назад

    Hi everyone. I hope you like the video. If you have any question feel free to ask, or you can just say hi. 😉 Thanks for watching guys.

  • @solomonndegwa9951
    @solomonndegwa9951 2 месяца назад

    Awesome

  • @ΕγωΕγω-ρ6ω
    @ΕγωΕγω-ρ6ω 2 месяца назад

    Welcome back 😊

  • @Rock_Film
    @Rock_Film 2 месяца назад

    Thanks Bro!

  • @DigitalFox-tutorials
    @DigitalFox-tutorials 2 месяца назад

    Hi everyone. Tell me what you think about the video. Is everything understandable?

    • @Rock_Film
      @Rock_Film 2 месяца назад

      Clear, concise, and straightforward!

  • @mark-dev-1
    @mark-dev-1 2 месяца назад

    Could you please do a tutorial with PDO and cover all these methods in an OOP way?

  • @tkar66
    @tkar66 2 месяца назад

    Awesome. very clear and helpful. Many thanks,

  • @DigitalFox-tutorials
    @DigitalFox-tutorials 2 месяца назад

    Hi everyone. Tell me what you think about the video. Is everything understandable?

  • @nicodemoscarfo
    @nicodemoscarfo 2 месяца назад

    Nice tutorial, what would be the code for adding elipsis with a rang of 5 buttons like < 1... 5 6 7 8 9 10 ...99 >

  • @expTRM
    @expTRM 3 месяца назад

    nice!

  • @stormybear4986
    @stormybear4986 3 месяца назад

    Mime in this context should be properly said as "My-mee" not "Myme"

  • @bibliothecaEsoterica
    @bibliothecaEsoterica 3 месяца назад

    Thank you Sir, you helped me with my website

  • @Electronieks
    @Electronieks 3 месяца назад

    I use your code , but when i use iphone and select a photo i took with my phone myself, to upload. , then its not working But when upload an image that i recieved from somebody in whatsapp and i store the image to my fotoalbum, then i can upload these images to the phpserver Any walkaround for this?

  • @gopichandlakshmisson4682
    @gopichandlakshmisson4682 3 месяца назад

    i have tried the same process yesterday i got success msg but today i am getting SMTP server error i dont know why

  • @amnifarihah-d2z
    @amnifarihah-d2z 3 месяца назад

    hi just want to let you know I still can't get it right even after I followed all the steps :( google setting doe not have the less secure settings alr

  • @SlametRiyadi-rj1um
    @SlametRiyadi-rj1um 3 месяца назад

    You running your html on the webserver right?

  • @ceketuveux
    @ceketuveux 3 месяца назад

    Thank you so much for this video. I have a question i could not solved since 3 days. How would i do to target only ONE image and style it in CSS ? For example if i want to change the width of the 2 second image ("id":2). How would i proceed ? Been searching answers for days..

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 3 месяца назад

      I am glad you liked the video, thank you. Now based on my code you can target the second image from the CSS file like this: table tr:nth-child(2) img{ width: 100%; } The above css code means that we are targeting every image in the second table row and set the width to 100% Hope it helps.

    • @ceketuveux
      @ceketuveux 3 месяца назад

      @@DigitalFox-tutorials Oh my god it is working! Amazing thank you so much. Do you know if it is possible to target any img in the DOM ? I tried desperately to target an img by changing the attribute/ID of any of those, but did not find how. I tried to use the "id" and "name" from the Json object properties to target one of those img but it did not work. Do you know if it is possible ?

    • @DigitalFox-tutorials
      @DigitalFox-tutorials 3 месяца назад

      You can change the number of the tr:nth-child to target the image you want: table tr:nth-child(3) img{ width: 100%; } // Targeting the third image. This is one way or you can ad - in the javascript file - ad an id attribute to the image tag combining text and the id property from the JSON file. <td><img id='image-id-${product.id}' src='${product.image}'> </td> and target the image you want using css like this: #image-id-1{ border: thin solid red; } #image-id-2{ border: thin solid blue; } #image-id-3 ... and so on... you get the point.

    • @ceketuveux
      @ceketuveux 3 месяца назад

      @@DigitalFox-tutorials Thank you so much, coffees on me. I wonder what is the point by doing all that on Javascript when you can do it with HTML/CSS ?

  • @SaloGemb-r1d
    @SaloGemb-r1d 3 месяца назад

    Miller Lisa Allen Helen Moore Sarah

  • @huaweitrainingsafrica3742
    @huaweitrainingsafrica3742 4 месяца назад

    Just what I needed for my project. Thank you very much