For many people, the main reson for learning a scripting language like PHP is because of the interaction with databases it can offer. In this tutorial I will show you how to use PHP and the MySQL database to store information on the web and include it into your website. Before you read this tutorial you should have at least a basic knowledge of how to use PHP. If you do not yet know PHP, I suggest that you read o... Read More »
Introduction So far you have learnt how to put information into your MySQL database, view the information in it and select which information you would like to view. In this part I will show you how to do the two final actions, updating your database and deleting records from it. ... Read More »
Introduction In the past two parts of this tutorial I have shown you how to take data out of the database and display it on screen. In this part I will enter into the final aspect of this data displaying, selecting one piece of data and stopping errors from happening when you output data. ... Read More »
Introduction Throughout this tutorial you have learnt how to create a database and table, insert information and display the database information. In this part I will show you more ways of displaying and outputting the information in the database. ... Read More »
Introduction So far in this tutorial, you have created a database and put information into it. In this part I will show you how to create an input page for your database, and how to display the whole contents. HTML Input... Read More »
Introduction Over the past two parts I have explained what I am planning to do in this tutorial and have shown you how to create a database to use with the tutorial. In this part I will be showing you how to insert some information into your database so that it is more useful. ... Read More »
Introduction Before you actually start building your database scripts, you must have a database to place information into and read it from. In this section I will show you how to create a database in MySQL and prepare it for the data. I will also begin to show you how to create the contacts management database. ... Read More »
Throughout this tutorial I have taught you how to use PHP to interact with a MySQL (or SQL) database and how to use the most common commands available. I have, throughout this tutorial, also shown you how to create a basic contacts management system to illustrate some of the options you can use. In this part I will show you some final MySQL tips and will give you a final version of the script. ... Read More »
[code]1.SELECT * FROM table WHERE MATCH (`field`) AGAINST ('Keyword')(Fastest)2.SELECT * FROM table WHERE MATCH (`field`) AGAINST ('+Keyword' IN BOOLEAN MODE)(Fast)3.SELECT * FROM table WHERE RLIKE '(^| +)Keyword($| +)'ORSELECT * FROM table WHERERLIKE '([[:space:]]|[[:<:]])Keyword([[:space:]]|[[:>:]])'(Slow)[/code]Contains searching1... Read More »
I read about many of these points in books and tutorials but I was rather lazy to think about many of them initially learned some of these lessons the hard way. Fortunately I didn’t lose any major data over security issues with PHP MySQL, but my suggestion to everyone who is new to PHP is to read these tips and apply them *before* you end up with a big mess.1. Do not trust user inputIf you are expecting an integer call intval() (or use cast) or if you don’t expec... Read More »