Create a PHP REST API : Write a RESTful API from Scratch using Plain, Object-Oriented PHP and MySQL

Ғылым және технология

Learn how to develop a complete, RESTful API using plain, object-oriented PHP, MySQL and best practices.
Full API course, including authentication:
‣ davehollingworth.net/phpapisy
Please consider supporting my channel:
☕ ko-fi.com/davehollingworth
In this video you'll learn how to:
• create RESTful URLs
• list, show, create, update and delete database records using an API
• organise your PHP code
• use controllers and table gateways
• return relevant HTTP status codes
• validate data in an API
• decode and encode requests and responses as JSON
Code shown in the video:
‣ github.com/daveh/php-rest-api
Relevant documentation:
‣ curl.se/
‣ www.postman.com/
‣ httpie.io/
‣ www.php.net/manual/en/functio...
‣ www.php.net/manual/en/pdo.set...
‣ www.php.net/manual/en/class.e...
00:00 Introduction
00:18 API client
00:31 Front controller
01:38 RESTful endpoints
02:03 URL rewriting
03:03 HTTPie usage
03:28 Routing
03:59 404 response
04:23 Collection and resource URLs
05:19 Controller class
06:27 Class autoloading
08:19 Process the request
09:06 Collection requests
09:55 JSON Content-type
10:56 Create the database
11:53 Connect to the DB
14:08 Exception handling
16:44 Table gateway class
17:42 List all records
19:52 Encode JSON values
21:35 Insert a record
21:55 Get request data
27:04 201 response
28:00 Error handling
30:00 Data validation
31:46 422 response
32:28 405 response
33:36 Resource requests
34:43 Get a resource
35:59 404 response
37:02 Update a resource
40:03 Conditional validation
41:12 Delete a resource
43:12 Summary
#PHP #MySQL #REST #API

Пікірлер: 192

  • @dave-hollingworth
    @dave-hollingworth2 жыл бұрын

    Out of interest, what data are you creating an API for?

  • @efbYouTube

    @efbYouTube

    2 жыл бұрын

    fun pet project (10 yrs in the making! 🙃) to create a user login & personal data store for a language gaming website using vanilla js (& react) on the ft end.

  • @william254

    @william254

    2 жыл бұрын

    Learning, I can create an API with a framework but wanted to learn doing it with plain PHP.

  • @williamurquhart5169

    @williamurquhart5169

    Жыл бұрын

    Personal project about tree varieties of all things.. whilst on break from MSc. This is great precursor to your Udemy course so thanks for posting!

  • @samuelonowuko110

    @samuelonowuko110

    Жыл бұрын

    A learning Management System. Want a flutter developer to build the mobile version using same data.

  • @rahulbansal9580

    @rahulbansal9580

    Жыл бұрын

    For learning. Thank you, Dave, for an amazing video.

  • @zzzbyyy
    @zzzbyyy10 ай бұрын

    my php back end skills are archaic ... so before I dive in any api php framework I want to learn how to do it in plain PHP ... this tutorial is a blessing for me ...

  • @manojphatak763
    @manojphatak7637 ай бұрын

    Quite simply: the best php tutorial I have seen so far! Thank you for your crystal clear explanations.

  • @med3060
    @med30602 жыл бұрын

    I've been searching for such amazing lesson for so long thank you so much Dave .

  • @collenzaligway4458
    @collenzaligway44582 жыл бұрын

    I love how clearly you explain things. Please keep posting videos cause its really straight forward and help me learn a lot.

  • @robertbinkowski
    @robertbinkowski Жыл бұрын

    This was amazing! Keep up the amazing work!

  • @NedumEze
    @NedumEze Жыл бұрын

    Come on Dave, I am still feeling dizzy watching this Video. How can you be so good! Simply no daylight between you and PHP ! Am in awe. Thank you so much, Dave. Sorry for myself trying to understand what you have taught so very well

  • @ademineshat
    @ademineshat2 жыл бұрын

    Very nice and modern PHP Crash course. Absolutely awesome. Thanks 🙏

  • @vasurupolia9481
    @vasurupolia9481 Жыл бұрын

    Dude, you must be a pro! Thanks for such a detailed description. I'm actually amazed why there are so less comments and likes. You deserves a million of likes and subscribers. Subscribed!😊

  • @william254
    @william2542 жыл бұрын

    One of the best tutorials I've seen, including paid ones. I really appreciate it and would love to see more.

  • @GenaroDesiaCoppola
    @GenaroDesiaCoppola Жыл бұрын

    hands-down one of the best coding tutorials I've seen, thank you, this helps me a lot

  • @NedumEze
    @NedumEze Жыл бұрын

    Stunning presentation. Wow! Dave. My jaw is on the floor! Thanks

  • @muhammadsharif5526
    @muhammadsharif5526 Жыл бұрын

    undoubtedly, one of the best PHP API instructors... full stop... subscribed

  • @royschrauwen
    @royschrauwen2 жыл бұрын

    Thank you very much for such a great tutorial! You explained everything very clearly, and the tutorial was easy to follow.

  • @dagore94
    @dagore94 Жыл бұрын

    Really good video, just the one I needed.

  • @shadrackkipkoech2075
    @shadrackkipkoech2075 Жыл бұрын

    The tuitorial was perfect. Very invaluable 🏆🏆🏆

  • @ll18307
    @ll183079 ай бұрын

    This is just what I need, Thank you very much. I love how the topic is explained, very concise and straight forward.

  • @jayk4272
    @jayk42722 ай бұрын

    thanks a lot! this is exactly what I was looking for, you explained everything really well, now I can go ahead and make my project

  • @khari_baat
    @khari_baat Жыл бұрын

    Thank you creating this wonderful video. You have helped a lot of people.

  • @AhmedHuzain
    @AhmedHuzain11 күн бұрын

    Thanks a lot. This is genuinely one of the best tutorials I've ever watched

  • @subhasismukherjee7435
    @subhasismukherjee74352 жыл бұрын

    Excellent Tutorial. Thanks Dave.

  • @julianharder1354
    @julianharder13547 ай бұрын

    This was very helpful, thank you!

  • @Aalii6
    @Aalii6 Жыл бұрын

    very clear explanation, thank you!

  • @chieeyeoh6204
    @chieeyeoh62046 ай бұрын

    I came from Node and Python. Your tutorial pace very well and the content was concise, gave me the confidence to build one API server with PHP todday.

  • @6962943
    @69629432 ай бұрын

    YOU ARE AWESOME! I now have a better understanding of APIs in PHP

  • @Kolkrabe1303
    @Kolkrabe1303 Жыл бұрын

    Great Tutorial, thank you very much for your time and effort!

  • @thiagomoretioficial
    @thiagomoretioficial10 ай бұрын

    You're really the best! Thank you so much

  • @johnlabuci96
    @johnlabuci966 ай бұрын

    you're very good dave, you teach and introduce us to the new term like table gateway pattern and many more along the tutorial.. kudos

  • @rodrodrigues1729
    @rodrodrigues1729 Жыл бұрын

    Best PHP RESTful API Tutorial ever. Close the other tabs and stick to this one.

  • @andersonbandeirabbbandeira1341
    @andersonbandeirabbbandeira13416 ай бұрын

    Thank you so much! Greetings from Brazil!

  • @heshamabuzaid4293
    @heshamabuzaid4293 Жыл бұрын

    Thanks a lot, it was very clear.

  • @techatival
    @techatival8 ай бұрын

    You are a great teacher!

  • @anantverma01
    @anantverma01 Жыл бұрын

    This is gold... thank you so much

  • @ebumumin
    @ebumumin8 ай бұрын

    Thanks man, so educative and clear. I am developing my first API at the middle of this video 😁

  • @craigc5879
    @craigc58792 жыл бұрын

    Absolutely awesome

  • @emperoroftheearth3215
    @emperoroftheearth32152 жыл бұрын

    Thanks.. that was very useful.. and i aslo liked your teaching style, its wonderful.. thanks again.

  • @fakh99
    @fakh9924 күн бұрын

    Well-explained source for learning APIs using PHP. Thanks for your efforts ❤

  • @chimdykekamsi
    @chimdykekamsi Жыл бұрын

    Great lesson, I don't normally comment but this deserves it. Thanks 📌📌📌📌📌📌✔✔✔✔✔✔👍👍

  • @laszlogyor6628
    @laszlogyor6628 Жыл бұрын

    Excellent video, thank you.

  • @lucledoux2184
    @lucledoux218418 күн бұрын

    thanks very helpfull to understand the basics

  • @rodrigoms8464
    @rodrigoms8464 Жыл бұрын

    excelent explication video, thanks from mexico!

  • @efbYouTube
    @efbYouTube2 жыл бұрын

    thats it! i'm officially done w/ .net 😁 many txs dave!!!!!

  • @yousef3464
    @yousef34649 ай бұрын

    fruitful tutorial, you are amazing

  • @dobrinivanov395
    @dobrinivanov3952 ай бұрын

    This is great! Perfect amount of explanation. I still have to dig in as I dont have PHP experience and this was exactly what I needed. great job!

  • @dobrinivanov395

    @dobrinivanov395

    7 күн бұрын

    Hey if you are wondering on some content, I can suggest utilising JWT access token to implement into REST API with PHP. That would be great for me, maybe other people need a tutorial on that as well as its pretty complex to grasp only from google search

  • @keyvanakbarzadeh
    @keyvanakbarzadeh10 ай бұрын

    Perfection i learned alott thank you❤

  • @user-ct7sz6wj5m
    @user-ct7sz6wj5m3 ай бұрын

    Thank you so much

  • @YoussefJassim
    @YoussefJassim Жыл бұрын

    Thank you ! Awesome

  • @MartinMllerSkarbiniksPedersen
    @MartinMllerSkarbiniksPedersenАй бұрын

    Thanks a lot.

  • @stefanoprea6801
    @stefanoprea68014 ай бұрын

    very cool vide, thanks!

  • @darkprogrammer9760
    @darkprogrammer97605 ай бұрын

    Thank you very much for the Great Explained Video. If you can, please make another one by explaining how to upload an image / Document using the API

  • @NoahNobody
    @NoahNobody Жыл бұрын

    I've started working with htmx recently and like that I don't have to work with json for the most part :) Still, this is a nice tutorial to set up a basic system to receive requests.

  • @ramsesramos2192
    @ramsesramos2192 Жыл бұрын

    HI Dave, this video is the best restapi creation on KZread, please do a video to secure the restapi with tokens or using jwt etc please please 🙏

  • @Borma425
    @Borma425 Жыл бұрын

    Wow Thanks

  • @ilya_123__
    @ilya_123__11 ай бұрын

    thank you

  • @alalyrealestate1136
    @alalyrealestate11368 ай бұрын

    Great as ever.. May you make a tutorial about htaccess and apache server

  • @manmoncang
    @manmoncang7 ай бұрын

    Tq. i want to be expert at Back End as no problem at Front End. Already subscribe your modul at udemy. tq

  • @davidef.982
    @davidef.982 Жыл бұрын

    Great one ! Thanks a lot By the way, Ibought the course on Udemy ! ... it definitively worth the money !

  • @satishnotiyal3939
    @satishnotiyal3939 Жыл бұрын

    Great

  • @Uchihaze
    @Uchihaze Жыл бұрын

    Thanks alot for your tutorial! I have a few questions. Before even creating the database in PHPmyAdmin, my HTTPie always returns ‘404 not found’ The only files i have are index.php, .htaccess and ProductController.php in a seperate src folder & when i try to create the database in PHPmyAdmin it will not create the table. I copied your code from github and do not understand what i’m doing wrong here or how to fix it.

  • @warka9494
    @warka9494 Жыл бұрын

    Awesome and nicely explained tutorial, thanks Dave. by any chance can you add Authentication to this tutorial ?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    It's on my list to do when I get chance, yes!

  • @FGP-PIANO
    @FGP-PIANO Жыл бұрын

    thank

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    welcome

  • @lukanikolic3827
    @lukanikolic38278 ай бұрын

    Can someone help: I got this error when I want to post data form React fornt to PHP back: response to preflight request doesn't pass access control check it does not have http ok status

  • @hamzalaabidi9448
    @hamzalaabidi94484 ай бұрын

    Good tutorial, I have a question if i want to add another another model for example user so i have to create another controller and gateway for it even configure the route Can you suggest a good architecture for it ?

  • @dave-hollingworth

    @dave-hollingworth

    4 ай бұрын

    I suggest using something like Slim - there's a full video on it here: kzread.info/dash/bejne/gnyO1tejk7e4gM4.html

  • @hellotech278
    @hellotech278 Жыл бұрын

    😍😍😍😍

  • @erenozdemir7914
    @erenozdemir7914 Жыл бұрын

    The course is very useful. Thanks a lot. I have a question. If we want to create another controller, such as categories. I could not understand how we should follow the actions in Index.php. Can you show a sample code snippet to create another controller?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    You'd have to create the controller class (and the gateway class if necessary) based on the URL segment, in the $parts[1] variable. A simple if-else statement would do the trick. You'd also have to modify the check for displaying a 404 status based on the URL to include another string.

  • @beticohernandez9536
    @beticohernandez9536 Жыл бұрын

    Que bueno.

  • @torn1k3
    @torn1k32 ай бұрын

    Dave do you have course where you implement PHP MySQL + GraphQL for querying? or do you recomend one?

  • @dave-hollingworth

    @dave-hollingworth

    2 ай бұрын

    I'm afraid not, but it's a good idea for a video, I'll make a note of it, thank you!

  • Жыл бұрын

    Thanks for this brilliant class! One question: why am I getting an error when I define array | false in this point: public function getUsuario(string $id): array | false ? I receive this message: syntax error, unexpected '|', expecting ';' or '{' in... Is there any special environment to run this way?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    That's a union type, which was introduced in PHP 8 - if you're getting an error, then you're using a version earlier than that. You can either upgrade to PHP 8, or remove those return type declarations.

  • @BeastFish22
    @BeastFish22 Жыл бұрын

    In the getConnection method why do always create a new instance of a PDO?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    To connect to the database - if you're calling the getConnection method more than once in a single request, then you could modify it to always return the same object

  • @sqdtnz
    @sqdtnz Жыл бұрын

    Very well explained. The only thing I got a little confused with was the switch case of POST/GET, and then also PATCH and DELETE, between processResourceRequest and processCollectionRequest. These are custom request methods? I guess I have missed something...

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    These are custom methods, yes. Basically the switch chooses which one to run based on the HTTP request method.

  • @sqdtnz

    @sqdtnz

    Жыл бұрын

    @@dave-hollingworth I have figured it out, watched it all over. This was a great tutorial, I have learned a lot in just one day. Thank you.

  • @Mescudi94
    @Mescudi94 Жыл бұрын

    Sorry again, Could I ask you which request software you are using in this video please ? Thank you very much, this tutorial is so well realized !

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    HTTPie - httpie.io/

  • @ambroiseadanledji6158
    @ambroiseadanledji6158 Жыл бұрын

    Thank you Dave for this tutorial. How can I make a route for another table. Let say user for example. Thank

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    You can just create more scripts that are similar to the ones in the tutorial but for a different table, e.g. create_user.php etc.

  • @MahdiMGH
    @MahdiMGH2 жыл бұрын

    Hi Dave. Do you have any course about basics of this toturial? I can't undestand this toturial. I have also learned your two MVC courses on Udemy.

  • @dave-hollingworth

    @dave-hollingworth

    2 жыл бұрын

    Yes, there's a link at the top of the description, thank you for your interest!

  • @amon-fanticelli1995
    @amon-fanticelli1995 Жыл бұрын

    those php code you wrote, are still usable nowadays or are they obsolete? nice class by the way, im a javascript/node dev, and im trying to learn php, your videos are the best i have seen so far

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Thank you for your kind words! Yes, the code is still current and not obsolete

  • @pau1phi11ips

    @pau1phi11ips

    8 ай бұрын

    It's rare for old PHP to not work in the latest version. Backwards compatibility is generally very good.

  • @samuelonowuko110
    @samuelonowuko110 Жыл бұрын

    Why did you choose to work in the htdocs folder directly, rather than a folder in the htdocs folder?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Just to keep it as simple as possible for the video.

  • @rodrigoms8464
    @rodrigoms8464 Жыл бұрын

    how do you add another route, like clients routes??

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    The check for the URL segment is to demonstrate returning a 404 response - to add other routes, you would change this check to include others; or if you have a lot of resources, consider using a router component or something like Slim

  • @idanportal8696
    @idanportal8696 Жыл бұрын

    Hi and thank you so much for this! I have one question though. I keep getting this error when trying to connect to the DB: "syntax error, unexpected 'private' (T_PRIVATE), expecting variable (T_VARIABLE)". Can't seem to find the issue. Do you have any idea what can it be?

  • @JCSkevin

    @JCSkevin

    Жыл бұрын

    Me too, did anyone else get and solve this?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Don't know why I didn't see this message earlier - what line of code is causing the error?

  • @JCSkevin

    @JCSkevin

    Жыл бұрын

    @@dave-hollingworth Found the problem: If you declare a __construct function with private parameters, you get the error, so the example would be in the declaration of the Database class. The reason is that this feature of allowing private parameters was only introduced in PHP v8. So anything less than this will generate the error. Now that I know this, I used the following to get the same result. PHP private string $host; private string $name; private string $user; private string $password; public function __construct( string $akahost, string $akaname, string $akauser, string $akapassword) { $this->host=$akahost; $this->name=$akaname; $this->user=$akauser; $this->password=$akapassword; } PHP > v8 public function __construct(private string $host, private string $name, private string $user, private string $password) {}

  • @lucasferreira8229
    @lucasferreira8229 Жыл бұрын

    what is the difference when using core/plain PHP and Laravel to create APIs?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Laravel does a lot for you, with plain PHP you have to do it all yourself. Plain PHP is simpler though and uses less resources, but Laravel is probably faster to develop once you know the framework, so it's up to you which one you use

  • @InspirationBroadcast
    @InspirationBroadcast2 жыл бұрын

    Please can you make a tutorial on the Twitter API using core PHP?

  • @dave-hollingworth

    @dave-hollingworth

    2 жыл бұрын

    Ok will add it to my list! Thank you for the suggestion :-)

  • @PickleADC
    @PickleADC Жыл бұрын

    very good tutorial about rest api. is there any way to provide the rewrite rules for nginx ?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    You could try something like this: winginx.com/en/htaccess

  • @johnlabuci96
    @johnlabuci966 ай бұрын

    dave, on minute 22:22 i try the post request products name="new product" but the page return forbidden.. i change it to products name='new product' and now it return 404 not found.. is there any place that i need to check or any setting that i need to change? thanks

  • @dave-hollingworth

    @dave-hollingworth

    6 ай бұрын

    Are you running the code in a subfolder? If so you need to take this into account when parsing the URL for its segments

  • @johnlabuci96

    @johnlabuci96

    6 ай бұрын

    @@dave-hollingworth im using laragon and my folder structure like this dave.. www/someFolder/testApi.php

  • @johnlabuci96

    @johnlabuci96

    3 ай бұрын

    ​@@dave-hollingworthi completed my project by following your tutorial.. thanks man

  • @beticohernandez9536
    @beticohernandez9536 Жыл бұрын

    Iras a terminar el proyecto?

  • @rhtservicestech
    @rhtservicestech Жыл бұрын

    I am attempting to replicate what you have done here. However the mod_rewrite is not working with the .htaccess file. I have confirmed that it is turned on in Apache using a2enmod on Linux. Any suggestions on how I can fix this ?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    If you can't get mod_rewrite to work, you could just have the URL as localhost/products.php instead, without rewriting the URL

  • @rhtservicestech

    @rhtservicestech

    Жыл бұрын

    @@dave-hollingworth I am using Apache. I did figure it out. The AllowOverride directive was set to None. When configured in this manner, htaccess is useless as Apache ignores it. Had to change it to All and then the htaccess file was recognized

  • @Mescudi94
    @Mescudi94 Жыл бұрын

    hello, I don't get it... How did you manage to send body POST request trough URL without any function created ? It don't work when I type "localhost/product "a new product" ! 🤨

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    In what way doesn't it work? Try comparing your code to the code in the video, there's a link in the description

  • @Mescudi94

    @Mescudi94

    Жыл бұрын

    @@dave-hollingworth Sorry Dave, I'm new to API. And in fact, in the video, I thought at first that when you were typing into the console your POST request , that you were typing it through a navigator URL like a $_GET, but now I 've understood :)

  • @williameduardo7020
    @williameduardo702010 ай бұрын

    This is great content. How do you secure it?

  • @dave-hollingworth

    @dave-hollingworth

    10 ай бұрын

    Using an API key is a common way (covered on the course linked to in the description)

  • @DMKano87
    @DMKano87 Жыл бұрын

    Unfortunately I got lost somewhere in the middle. I will finish this tutorial, but at the moment it's too complicated for me ;)

  • @DavidShaw-dc4re
    @DavidShaw-dc4re Жыл бұрын

    At @22:20 I am using HTTPie web app to do the testing and when I ran POST webserver/products name="xxx" it get a 404 status response. ... $parts = explode("/", $_SERVER['REQUEST_URI']); if ($parts[1] != "products") { http_response_code(404); exit(); { ... I examined the contents of $parts[1] and it is "products%20name=%22xxx%22" What am I doing wrong? My code worked up until this point like in the video.

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    It looks like there's a query string in your URL - what is the exact HTTPie command you're using?

  • @DavidShaw-dc4re

    @DavidShaw-dc4re

    Жыл бұрын

    @@dave-hollingworth POST localhost/products name="xxx" I put in a a json echo of $parts[1], ignore all but "file" as they are hard coded. { "code": 404, "message": "Not Found", "file": "ncrs%20name=%22xxx%22", "line": "" } Ya I thought the same, about the querystring. You are using the desktop version of HTTPie? I was using the web version, is there a setting somewhere to tell it to treat /products name="xxx" as a form body rather than a querysytring? I asked because I searched the UI and didn't find anything.

  • @DavidShaw-dc4re

    @DavidShaw-dc4re

    Жыл бұрын

    Regardless moving on to your online course today, great stuff.

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    @@DavidShaw-dc4re I'm using the command-line version of HTTPie, I haven't tried the other versions yet I'm afraid

  • @NedumEze
    @NedumEze Жыл бұрын

    Hi, Dave, could you consider helping with the expanded .htaccess rules? Secondly, could you extend this Video to add the making of a Mobile App using PHP for Server Side scripts?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Of course, what do you want to do with the .htaccess file?

  • @mongodb5166
    @mongodb5166 Жыл бұрын

    Is there a diff between using httpie desktop and terminal? Im using desktop version and if i try to make a POST i all time get 403 response "Forbidden You don't have permission to access this resource." GET Works fine but POST wont work at all.. after 2 hours trying to fix i have no clue why it won't work :/

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    There shouldn't be a difference as far as the code on the server is concerned, no - where is the 403 error coming from, your code or is the server generating it? It could be a permissions problem if you have the script in another folder

  • @fitrylol6716

    @fitrylol6716

    10 ай бұрын

    I have similar issue right now 403 forbidden, GET work fine, have resolved the issue? if yes ,how?

  • @RahulKumar-dm5zy
    @RahulKumar-dm5zy2 жыл бұрын

    I have created a rest api using codeigniter 4, now the issue is, data return from api all data is in string data type, to to get data in their original datatype, like boolean value in true/false, ids in number, names in string.

  • @dave-hollingworth

    @dave-hollingworth

    2 жыл бұрын

    If you connect using PDO, you can configure this by changing some PDO settings, details here: kzread.info/dash/bejne/imllrbGDe9XVlrg.html

  • @RahulKumar-dm5zy

    @RahulKumar-dm5zy

    2 жыл бұрын

    @@dave-hollingworth very very thanks for your reply sir, i solved this issue with entity class provided by codeigniter 4 by casting, for example in userEntity i cast columns like this, proctected $cast =['id' =>'int', 'balance'=>'float','status'=>'bool'].

  • @ajsabini
    @ajsabini Жыл бұрын

    Hi, i want to buy this course in udemy, appears 13.99 U$S but when i go to buycharge 84 U$S, can you help me?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Try this link: www.udemy.com/course/php-apis/?couponCode=9B22746697922B9BEAFA

  • @ll18307
    @ll183079 ай бұрын

    Hello Dave, 23: Do you know why I keep getting response 403 Forbidden when I type this /products name="A new product" Thank you

  • @dave-hollingworth

    @dave-hollingworth

    9 ай бұрын

    What are you using to make the request? (e.g. HTTPie, cURL)

  • @ll18307

    @ll18307

    9 ай бұрын

    @@dave-hollingworth I am using httpie desktop app

  • @ll18307

    @ll18307

    9 ай бұрын

    @@dave-hollingworth hi, it appears that I can't put the inputs in the URL, except for the id. all other fields have to be put in the body in json instead of putting it in the url.

  • @dave-hollingworth

    @dave-hollingworth

    9 ай бұрын

    Not sure why that's happening without being able to reproduce it, but if that works for you, no problem

  • @xanzerex1926
    @xanzerex19262 жыл бұрын

    It is possible to make an online ordering without api?, can you please make a simple online ordering system that have database and crud

  • @dave-hollingworth

    @dave-hollingworth

    2 жыл бұрын

    Yes, you can have an online ordering system without an API - will add that to my list, thank you for the suggestion

  • @xanzerex1926

    @xanzerex1926

    2 жыл бұрын

    @@dave-hollingworth thank you for considering my humble request 🤩

  • @beticohernandez9536
    @beticohernandez9536 Жыл бұрын

    Hello, Can that api be used with React?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Absolutely, I don't see why not

  • @seeker3794
    @seeker3794Ай бұрын

    What I hate about php tutorials, is that there is no any backend or frontend distinction and every other file is in .php extension. What about js html extensions or RESTful API?

  • @TITAN-sv5eg
    @TITAN-sv5eg Жыл бұрын

    Dave Hollingworth can you gve me the tutoria api corse for free? i cant buy it

  • @ddobren
    @ddobren Жыл бұрын

    Add auth etc

  • @TheJohcker
    @TheJohcker2 жыл бұрын

    Please can you make a tutorial secure php ?

  • @dave-hollingworth

    @dave-hollingworth

    2 жыл бұрын

    Ok will consider it! Thanks for the suggestion!

  • @MenAmongTheRuins77
    @MenAmongTheRuins77 Жыл бұрын

    5 minutes in and i already learned more than from 12 hr indian courses

  • @code7882
    @code7882 Жыл бұрын

    I have a question about insert data in API, can you help me please?

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    Of course - please give as much detail as you can in your question.

  • @code7882

    @code7882

    Жыл бұрын

    @@dave-hollingworth can you give contacts? maybe instagram or another social media

  • @dave-hollingworth

    @dave-hollingworth

    Жыл бұрын

    @@code7882 My contact details are here: davehollingworth.com/contact

Келесі