I've always been curious about how PHP works and how things connect together. It's pretty straight forward.
Simple code to connect to a database running locally and pulling some data from a table.
Files you should be looking at ar get_data.php
and put_data.php
Make sure you have MySQL configured and running on your system.
If you're on Windows and running IIS
, you'd better go to c:\inetpub\wwwroot
and paste these php files.
If you're using XAMPP , you should go to path\xampp\htdocs
and paste the php files.
There are some funky issues with XAMPP , especially if you're running Skype. Go to the config portion of Apache and customize ports.
In httpd.conf
change Listen 80
to Listen <your choice of port>
change ServerName localhost:80
to ServerName localhost:<your choice of port>
In httpd-ssl.conf
change Listen 433
to Listen <your choice of port>
change <VirtualHost _default_:443>
to <VirtualHost _default_:<yourchoice> >
change ServerName www.example.com:443
to ServerName www.example.com:<your choice>
If you want to contribute or add to it or make it better, more readable, go for it. Tweet me issues if you can : @shreyaslumos
PHP-MySQL is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.