In this tutorial I go over deleting rows, not only in PHPMyAdmin, but in PHP as well. Once rows are deleted, they are not coming back. On the side note, it is good to use something that is unique to every row when modifying them or deleting them. Otherwise you can delete anything that matches the name being “orange” and delete two rows. This is why I usually always have an ID field in my rows.
Source used after the jump;
Read more…
-
26Dec
Tags: Deleting, MySQL, PHPMyAdmin
-
13Dec
I made a visual animation that will hopefully give light to those who are more visual learners.
-
11Dec
By using PHPMyAdmin, we can first create the result we want to have in our code, and then copy the SQL into PHP and query it with mysql_query($sql). However we need to save the result for further data retrieval. Next, we need to count how many rows there are as an error prevention measure with mysql_num_rows($result), and then find the rows one at a time with mysql_fetch_array($result) within a loop.
Take a look at the source after the jump to see what I mean, or just watch the video.
Source used after the jump;
Read more… -
05Dec
PHPMyAdmin allows you to easily administer MySQL databases and it can provide the SQL statements used so you can redo what you did in php code.
First, it is important that you have a user to administer the database with, then you can connect to it through PHP. After that, you need to connect to the database, and then select the database that you are going to operate in. After that, you can safely execute your queries. However, to be truely safe, if you are handling variables that you generate, or the user has access to, you will want to use mysql_real_escape_string to protect yourself from SQL Injection.