webdevelopment
- 3
- 0
I want to learn about and PHP and MysQuL. Someone tell me How to learn it?
The discussion revolves around learning PHP and MySQL, focusing on methods, tools, and resources for beginners. Participants share their experiences and suggestions on how to effectively start programming with these technologies.
Participants express differing opinions on the best approach to learning PHP and MySQL, particularly regarding the use of web servers versus command line interfaces. There is no consensus on whether beginners should focus on web server configurations or if they can learn PHP effectively without that knowledge.
Some participants highlight the need for a basic understanding of web server operations, while others argue that this knowledge is not essential for beginners. The discussion reflects a variety of perspectives on the learning process and the tools involved.
Beginners interested in learning PHP and MySQL, educators looking for teaching resources, and developers seeking to understand different approaches to web development.
Use your computer because it's faster than web servers andI use xampp for that.elusiveshame said:First you need to have a means to run php scripts as well as run MySQL, either from an existing web hosting service or on your own computer. Then you start learning the syntax, programming logic, etc.
adjacent said:Use your computer because it's faster than web servers andI use xampp for that.
elusiveshame said:Agreed. There are also IIS plugins for windows
Borek said:Xampp works perfectly well under Windows.
All you need to learn PHP as a beginner is the PHP library itself plus a web server to serve your client requests implemented and provoked via use of PHP language, its included application files and tools after a successful installation of it is done. Many servers nowadays run on Unix systems (without GUI), so you need to learn Linux or Unix terminal well (common tasks such as installing and updating/upgrading components, spawning processes and running them in the background, compiling files, searching and displaying, backtracking memory used by processes, networking etc are a few of priorities coming to my mind now). If you choose to do things with PHP in a fairly big company, you are meant to work with the so called the back-end technology, and so the front-end technology (GUI designs, javascript, css html etc) is left for others.elusiveshame said:Ah, I'm not familiar with xampp, to be perfectly honest. I thought it was a Linux specific software. Looks like another thing I need to learn about :) thanks for that!
I highly recommend against doing it that way to learn. That adds an extra level of complexity, you'll have to install and configure apache,it's modules, and add a link to the php in the conf.d file. I recommend just running from the command line, if he's trying to learn how to interface with mysql, adding a web server to the mix makes things harder.Silicon Waffle said:All you need to learn PHP as a beginner is the PHP library itself plus a web server to serve your client requests implemented and provoked via use of PHP language
<?php
echo "Hello world, I am PHP!" . PHP_EOL;
$dbname = 'mytestschema';
$host = 'localhost';
$connection = new \PDO(
"mysql:dbname=$dbname;host=$hostip",
'username',
'password'
);
if ($connection){
echo 'Got the MySQL connection!' . PHP_EOL;
} else {
die('Couldn\'t create the MySQL connection');
}
php test.php
Being without knowing how to configure his web server I think will be the biggest mistake he makes in learning PHP in the first place. Web servers run with predefined configured files. I can't imagine one claiming he would want to learn things in close relation to those web servers but ignore their configuration file contents. Basically, he will not learn where his root directory is,newjerseyrunner said:[...] adding a web server to the mix makes things harder.
[...]
<?php
date_default_timezone_set("UTC");
$dates = array("May 19, 2014", "Jun 18, 2014");
foreach ($dates as $date) {
$days_elapsed = intval((strtotime("today") - strtotime($date)) / 86400);
$days = ($days_elapsed != 1) ? "days" : "day";
$years = floor($days_elapsed / 365.2425);
if ($years == 0)
$stop = ".";
elseif ($years > 0)
$stop = str_repeat("!", $years);
else
$stop = "...?!";
echo "$date was $days_elapsed $days ago${stop}\n";
}
?>
$ php date.php
May 19, 2014 was 463 days ago!
Jun 18, 2014 was 433 days ago!