12/22/2023 0 Comments Idatabase registration code generatorIf you’re not familiar with php, any line that begins with a // is a comment, and comments are used by developers to document their code. Below is the example code that we created. Now that we have our sample SQL query, we can use it to create the php code that will print all comments on a page. As of 7.0, the code has been removed and replaced with mysqli_fetch-array. Note that mysqli_fetch_array was deprecated in PHP versions below 7.0. Setting up our PHP code to SELECT our comments Enter 1 for the “Value” of “articleid” and then click “Go”.If you’re following our example, we’ll first click on “_mysite” and then “comments”. In the left menu, first click your database name and then click the table to work with.Log into cPanel and click the phpMyAdmin icon. If you’re not familiar with SQL, you can use phpMyAdmin to help write your SQL command. For example, when the user is on page 1, we’ll select all of the comments in the database assigned to page “1”. This ID number will be used to gather comments for that specific page. When we setup our site we created two pages, and each page was assigned a unique id number. In order to display comments on a page, we first need to know what comments to show. Create our SQL Query to grab all comments In this article, we’re going to show you how to use PHP to Connect to and Retrieve Data from MySQL. In our previous set of articles, we’ve created a simple 2 page website that allows users to submit comments about the page they were looking at.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |