Here, we have used the for loop along with the range() function to iterate 10 times. The arguments inside the range() function are (1, 11). Meaning, greater than or equal to 1 and less than 11. We have displayed the multiplication table of variable num (which is 12 in our case). You can change the value of num in the above program to test for other values.
Code PHP Online is a free interactive online PHP code editor which helps you to write and execute your PHP code online from your web browser. This is one of the simplest and most powerful online PHP code editor tool available over the internet. Code PHP Online also offers free tutorials.
Run your code again, and you should see Database NOT Found printed out (unless you have a database called addressbook2). Change the database name back to addressbook. Now that we've connected to MySQL, and connected to a database, it's time to close the connection.
Download Tizag.com's PHP Book. If you would rather download the PDF of this tutorial, check out our PHP eBook from the Tizag.com store. Print it out, write all over it, post your favorite lessons all over your wall! Found Something Wrong in this Lesson? Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!
This tutorial will walk you through creating a simple address book using PHP and MySQL. Before you can begin you need to decide what fields you wish to include in our address book. For this demonstration, we will use Name, E-mail and Phone number, although you can modify it to include more options if you like.
Simple HTML code for designing of a registration form. Very basic for new learners.
For someone who had little database and programming knowledge, seeing those table rows show up onscreen based on the code I wrote (okay so I copied an example from a book -- let's not split hairs) gave me a triumphant high.