{"id":8737,"date":"2022-08-21T00:50:07","date_gmt":"2022-08-20T23:50:07","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=8737"},"modified":"2023-10-29T21:28:43","modified_gmt":"2023-10-29T21:28:43","slug":"building-a-php-website-input-button-for-db-connection","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/building-a-php-website-input-button-for-db-connection\/","title":{"rendered":"Building A PHP Webpage Input Button for DB Connection"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8737\" class=\"pvc_stats all  \" data-element-id=\"8737\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>First PHP Lesson Today, with tutor - DB\/prog guru Joe Moore.<\/p>\n<p><a href=\"https:\/\/databasejoe.com\/\">https:\/\/databasejoe.com\/<\/a><\/p>\n<p>This lesson will rely on you researching required VSCode shortcuts yourself: \"Ctrl \/\" and \"Shift 1\" plus the usual Save, Select All, Undo etc - which you know..? See main site page if not.<\/p>\n<p>Install VS code from .deb <a href=\"https:\/\/code.visualstudio.com\/download\">https:\/\/code.visualstudio.com\/download<\/a><\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install mysql-workbench phpmyadmin<\/span><\/p>\n<p>I'm completely new to PHP programming, and programming in general is my nemesis...but plod on, there's a massive skills shortage! (Any wonder with the complexity of programming?!)<\/p>\n<p>I like to work on projects that achieve something, not just exercises for the sake of it, as there's no sense of achievement, so Joe suggested we work on a \"real world\" example - an text input box with a submit button. I later asked to have it update a database table, so we did! Here's how...<\/p>\n<p>First, In VS Studio, we added the PHP extension PHP Intellisense :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-8751 alignnone\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/Intellisense.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/p>\n<p>A practical first page was written into the directory \/var\/www\/myfirstwebform\/phpinfo.php\u00a0 using the Add Page + button:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-8753 aligncenter\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/add-page.png\" alt=\"\" width=\"935\" height=\"542\" \/><\/p>\n<p>VS Studio autocomplete is used by typing first few letters of desired code, then Rtn highlighted text:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-8755 alignnone\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/autocomplete.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/p>\n<div>\n<div>&lt;?php<\/div>\n<div>echo phpinfo(); \/* this will give table form page of PHP version.<\/div>\n<div>Type phpinfo.php after folder in addr bar *\/<\/div>\n<div>?&gt;<\/div>\n<\/div>\n<div><\/div>\n<div>Ctrl S to save, then go to your \/var\/www\/&lt;yourdir&gt; folder in your browser address bar - in my case a subdir of \/var\/www\/myphpsite\/myfirstwebform\/<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8829\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/dir.png\" alt=\"\" width=\"685\" height=\"305\" \/><\/div>\n<div><\/div>\n<div>Type phpinfo.php in the addr bar - if you click the file, Chrome will want to download it, not run it!<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8831\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/phpinfophp.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>Next we built the index.html in stages.\u00a0 A new file in VSCode again using the code completion of VSCode:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8833\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/htmlcode1.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>Using Ctrl \/, to Autofill a comment box\u00a0 and type comment in the middle:<\/div>\n<div>\n<div>\n<div><span style=\"color: #00ff00;\">&lt;!-- meta tag is info, ctrl \/\u00a0 for comment fill, but only ABOVE other code else overwrites it --&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>To add the html skeleton, type Shift 1.<\/div>\n<div>A box shows with the code, so Enter to add the code:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8836\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/shift1.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8837\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/htmlskelshift1.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>In the &lt;body&gt; section, the actions and DB table info will be placed. The DB tables will be added to the DB table later, for the webpage text input to be sent to, after the page box and button is working first:<\/div>\n<div><\/div>\n<div>\n<div>\n<div><span style=\"color: #00ff00;\">&lt;!-- for form, type form, then Up\/Down for menu from select box --&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8842\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/formshtcut.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>Start typing\u00a0 \"action\" after \"form \", then enter when button explanation shows:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8844\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/formaction.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>With cursor in the \"action=\", type \"form\", enter on menu:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8847\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/formphp.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>Continue with text completions as per full code below:<\/div>\n<div>---<\/div>\n<div>\n<div>\n<div><span style=\"color: #ff0000;\">&lt;!-- shift + 1 for html skeleton--&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;!DOCTYPE html5&gt; &lt;!--use html5 tab--&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;html lang=\"en\"&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;head&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;!-- meta tag is info, ctrl \/ , but only ABOVE other code else overwrites it --&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;metacharset=\"UTF-8\"&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;metahttp-equiv=\"X-UA-Compatible\"content=\"IE=edge\"&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;metaname=\"viewport\"content=\"width=device-width, initial-scale=1.0\"&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;title&gt;Document&lt;\/title&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;\/head&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;body&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;!-- for form, type form, then Up\/Down for menu from select box --&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;formaction=\"form.php\"method=\"post\"&gt;&lt;!--post is pushing data, get is pulling--&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;inputtype=\"text\"name=\"sometext\"\/&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;inputtype=\"submit\"value=\"Submit Text\"\/&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;\/form&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;\/body&gt;<\/span><\/div>\n<div><span style=\"color: #ff0000;\">&lt;\/html&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div>---<\/div>\n<div><\/div>\n<div><span style=\"color: #ffffff;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8849\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/inputtext.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/span><\/div>\n<div><\/div>\n<div>Once the form is complete, it can be tested in your browser. Type the form name as below in the address bar:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8851\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/textbox.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>With no DB added yet, the default behaviour of the button for any added text may be to offer to download the form.php file:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8853\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/nodb.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>Let's add a DB named after the elements in the next code file: A DB named myphpsite, with a table named \"text\". The code is entered into a file named form.php:<\/div>\n<div><\/div>\n<div>---<\/div>\n<div>\n<div>\n<div>&lt;?php<\/div>\n<div>$sometext = $_POST['sometext']; \/\/ variable POST is php specific - single line comment<\/div>\n<div>\/*<\/div>\n<div>multi line comment<\/div>\n<div>*\/<\/div>\n<div>\/\/connect to mysql<\/div>\n<div>$db = new mysqli(\"localhost\",\"stevee\",\"poop\",\"myphpsite\"); \/\/ host, user, passwd, DBname<\/div>\n<div>\/\/ connection error msg<\/div>\n<div>if ($db-&gt;connect_errno) { \/\/ connect_errno is property of mysqli class (w3 skool bad code spaces origin)<\/div>\n<div>echo\"Failed to connect to MySQL: \".$db-&gt;connect_error;<\/div>\n<div>exit();<\/div>\n<div>}<\/div>\n<div>\/\/ insert into mysql query<\/div>\n<div>$sql = \"INSERT INTO text (sometext) VALUES ('$sometext')\" ; \/\/ DB Table = \"text\". Var sometext puts input varchars to column<\/div>\n<div>if ($db-&gt;query($sql))<\/div>\n<div>{<\/div>\n<div>echo\"Added to database\" ;<\/div>\n<div>}if($db-&gt;errno)<\/div>\n<div>{<\/div>\n<div>echo\"failed to insert into database: $db-&gt;error\" ; \/\/ can also be shown as to concat \".\"<\/div>\n<div>}<\/div>\n<div>?&gt;<\/div>\n<div>&lt;!DOCTYPE html&gt;<\/div>\n<div>&lt;html lang=\"en\"&gt;<\/div>\n<div>&lt;head&gt;<\/div>\n<div>&lt;metacharset=\"UTF-8\"&gt;<\/div>\n<div>&lt;metahttp-equiv=\"X-UA-Compatible\"content=\"IE=edge\"&gt;<\/div>\n<div>&lt;metaname=\"viewport\"content=\"width=device-width, initial-scale=1.0\"&gt;<\/div>\n<div>&lt;title&gt;Document&lt;\/title&gt;<\/div>\n<div>&lt;\/head&gt;<\/div>\n<div>&lt;body&gt;<\/div>\n<div>&lt;p&gt;You typed in the word: &lt;?phpecho$sometext?&gt;&lt;\/p&gt;&lt;!-- echos the value of text box input of sometext--&gt;<\/div>\n<div>&lt;\/body&gt;<\/div>\n<div>&lt;\/html&gt;<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>---<\/div>\n<div><\/div>\n<div>I added the DB in mysql:<\/div>\n<div><span style=\"color: #0000ff;\">sudo mysql -u root -p<\/span><\/div>\n<div><\/div>\n<div>\n<p><span style=\"color: #ff0000;\">mysql&gt; create database myphpsite ;<\/span><br \/>\n<span style=\"color: #ff0000;\">Query OK, 1 row affected (0.01 sec)<\/span><\/p>\n<p><span style=\"color: #ff0000;\">mysql&gt; show databases ;<\/span><br \/>\n<span style=\"color: #ff0000;\">+------+<\/span><br \/>\n<span style=\"color: #ff0000;\">| Database |<\/span><br \/>\n<span style=\"color: #ff0000;\">+------+<\/span><br \/>\n<span style=\"color: #ff0000;\">| information_schema |<\/span><br \/>\n<span style=\"color: #ff0000;\">| DebianAdmin |<\/span><br \/>\n<span style=\"color: #ff0000;\">| ElectronicsStuff |<\/span><br \/>\n<span style=\"color: #ff0000;\">| myphpsite |<\/span><br \/>\n<span style=\"color: #ff0000;\">| mysql |<\/span><br \/>\n<span style=\"color: #ff0000;\">| performance_schema |<\/span><br \/>\n<span style=\"color: #ff0000;\">| phpmyadmin |<\/span><br \/>\n<span style=\"color: #ff0000;\">| python_progs |<\/span><br \/>\n<span style=\"color: #ff0000;\">| srdb |<\/span><br \/>\n<span style=\"color: #ff0000;\">| sys |<\/span><br \/>\n<span style=\"color: #ff0000;\">| test |<\/span><br \/>\n<span style=\"color: #ff0000;\">| wordpress |<\/span><br \/>\n<span style=\"color: #ff0000;\">| wp |<\/span><br \/>\n<span style=\"color: #ff0000;\">+------+<\/span><br \/>\n<span style=\"color: #ff0000;\">13 rows in set (0.00 sec)<\/span><\/p>\n<\/div>\n<div>Now, a table named \"text\" can be created in the DB, as seen named in the code on line\u00a0 19:<\/div>\n<div>\n<div>\n<div>$sql = \"INSERT INTO text (sometext) VALUES ('$sometext')\" ; \/\/ DB Table = \"text\". Variable $sometext puts input varchars to the column of the DB table.<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>Just for variation, I'll use phpmyadmin.<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8856\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/phpmyadmin.png\" alt=\"\" width=\"1366\" height=\"768\" \/><\/div>\n<div><\/div>\n<div>In SQL preview you can also get the SQL code if you wish to use mysql command line to create the table:<\/div>\n<div><span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/create-table.html\" target=\"mysql_doc\" rel=\"noopener\">CREATE<\/a><\/span>\u00a0<span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/create-table.html\" target=\"mysql_doc\" rel=\"noopener\">TABLE<\/a><\/span>\u00a0<span class=\"cm-variable-2\">`myphpsite`<\/span>.<span class=\"cm-variable-2\">`text`<\/span>\u00a0(\u00a0<span class=\"cm-variable-2\">`sometext`<\/span>\u00a0<span class=\"cm-builtin\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/string-types.html\" target=\"mysql_doc\" rel=\"noopener\">VARCHAR<\/a><\/span>(<span class=\"cm-number\">255<\/span>)\u00a0<span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/charset.html\" target=\"mysql_doc\" rel=\"noopener\">CHARACTER<\/a><\/span>\u00a0<span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/charset.html\" target=\"mysql_doc\" rel=\"noopener\">SET<\/a><\/span>\u00a0utf8\u00a0<span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/charset-collations.html\" target=\"mysql_doc\" rel=\"noopener\">COLLATE<\/a><\/span>\u00a0utf8_unicode_ci\u00a0<span class=\"cm-keyword\"><a class=\"cm-sql-doc\" href=\"https:\/\/stevepedwards.today\/phpmyadmin\/url.php?url=https:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/logical-operators.html#operator_not\" target=\"mysql_doc\" rel=\"noopener\">NOT<\/a><\/span>\u00a0<span class=\"cm-atom\">NULL<\/span>\u00a0)\u00a0<span class=\"cm-keyword\">ENGINE<\/span>\u00a0=\u00a0<span class=\"cm-keyword\">InnoDB<\/span>;<\/div>\n<div><\/div>\n<div>Once created I had to reboot Mint to get it to work, just restarting with:<\/div>\n<div><span style=\"color: #0000ff;\">sudo service mysql restart<\/span><\/div>\n<div><span style=\"color: #0000ff;\">sudo service mysql apache2<\/span><\/div>\n<div><\/div>\n<div>did not work properly, as the page kept offering to DL the form.<\/div>\n<div><\/div>\n<div>Now it accepts the text and stores it in the DB table:<\/div>\n<div><\/div>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-8861\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2022\/08\/result.png\" alt=\"\" width=\"593\" height=\"189\" \/><\/div>\n<div>Now you can try to break it or generate error, example add more than 255 characters that the VARCHAR field was set to:<\/div>\n<div><\/div>\n<div>Interesting..I found it could go a couple of chars over 255 before complaining. I generated 256 letter \"a\" 's\u00a0 using the command line example on the main site page and amended it to suit then put the chars in a text file to count them with <span style=\"color: #0000ff;\">wc -m<\/span>:<\/div>\n<div><\/div>\n<div><span style=\"color: #0000ff;\">for x in {0..255}; do printf a ; done &gt; Desktop\/256as.txt<\/span><\/div>\n<div><\/div>\n<div>Checking the chars count should be 256 (0-255) :<\/div>\n<div>stevee@localhost:~$ <span style=\"color: #0000ff;\">wc -m Desktop\/256as.txt<\/span><br \/>\n256 Desktop\/256as.txt<\/div>\n<div><\/div>\n<div>\n<div>\n<div>Opening with a text editor,\u00a0 SelectAll text then pasted into the page submit field, I got, as expected:<\/div>\n<\/div>\n<div><\/div>\n<div>\n<p><span style=\"color: #00ff00;\">failed to insert into database: Data too long for column 'sometext' at row 1<\/span><span style=\"color: #00ff00;\">You typed in the word: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.......<\/span><\/p>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_8737\" class=\"pvc_stats all  \" data-element-id=\"8737\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>First PHP Lesson Today, with tutor - DB\/prog guru Joe Moore. https:\/\/databasejoe.com\/ This lesson will rely on you researching required VSCode shortcuts yourself: \"Ctrl \/\" and \"Shift 1\" plus the usual Save, Select All, Undo etc - which you know..? See main site page if not. Install VS code from .deb https:\/\/code.visualstudio.com\/download sudo apt install <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/building-a-php-website-input-button-for-db-connection\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Building A PHP Webpage Input Button for DB Connection<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8737","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=8737"}],"version-history":[{"count":56,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8737\/revisions"}],"predecessor-version":[{"id":10108,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/8737\/revisions\/10108"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=8737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=8737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=8737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}