{"id":26871202,"url":"https://github.com/codeadamca/php-big-picture","last_synced_at":"2025-03-31T07:18:46.010Z","repository":{"id":115328378,"uuid":"264954028","full_name":"codeadamca/php-big-picture","owner":"codeadamca","description":"A basic walkthrough of using PHP to display content from a MySQL database. ","archived":false,"fork":false,"pushed_at":"2025-01-26T22:10:28.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T23:18:55.890Z","etag":null,"topics":["database","learning-code","mysql","php","sql"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeadamca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-18T13:51:12.000Z","updated_at":"2025-01-26T22:10:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"e43be6f7-4049-4e33-89f1-3273b7948de4","html_url":"https://github.com/codeadamca/php-big-picture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-big-picture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-big-picture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-big-picture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fphp-big-picture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/php-big-picture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246429487,"owners_count":20775809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","learning-code","mysql","php","sql"],"created_at":"2025-03-31T07:18:45.496Z","updated_at":"2025-03-31T07:18:45.989Z","avatar_url":"https://github.com/codeadamca.png","language":"PHP","readme":"# A Basic Introduction to PHP and MySQL\n\nA basic walkthrough of using PHP to display content from a MySQL database. \n\nThis walkthrough is meant to illustrate the process of using PHP to display database content in an HTML web page. This is not meant to be a tutorial, more of a quick example of the end goal of these series of PHP tutorials. \n\n## Code Explanation\nThis block of code will connect our PHP file to the MySQL database:\n \n```php\n\u003c?php \n\n$connect = mysqli_connect( 'localhost', 'root', 'root', 'sandbox' );\n\n?\u003e\n```\n\nThis block of code will execute an SQL query and display the result using basic HTML:\n\n```php\n\u003c?php\n\n// Select all records from the topics table\n$query = 'SELECT *\n  FROM topics\n  ORDER BY name';\n$result = mysqli_query( $connect, $query );\n\n// Loop through each record\nwhile( $record = mysqli_fetch_assoc( $result ) )\n{\n\n  // Display each record\n  echo '\u003chr\u003e';\n  echo '\u003ch2\u003e'.$record['name'].'\u003c/h2\u003e';\n  echo '\u003ca href=\"'.$record['website'].'\"\u003e'.$record['website'].'\u003c/a\u003e';\n  echo '\u003cbr\u003e';\n  echo '\u003cimg src=\"'.$record['image'].'\"\u003e';\n\n}\n\n?\u003e\n```\n\n\u003e Full tutorial URL:  \n\u003e https://codeadam.ca/learning/php-big-picture.html\n\n***\n\n## Repo Resources\n\n* [Visual Studio Code](https://code.visualstudio.com/)\n* [Filezilla](https://filezilla-project.org/) (or any FTP program)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fphp-big-picture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fphp-big-picture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fphp-big-picture/lists"}