Topic: PHP

mysql_fetch_assoc() expects parameter 1 to be resource, provided boolean: Reason and Solution

Mysql_fetch_assoc() expects parameter 1 to be resource but boolean is provided can be caused due to various reason. We have to analyse the code and hand the issue accordingly. NOTE: The mysql_ functions are deprecated and have been removed in php version 7. So we are going to use mysqli_function Reason: If we are using […]

SQL – Delete Command

Situation may rise where we may want to delete data from a table. To tackle such situation, SQL is providing Delete command. By using SQL delete command we can instruct mysql to delete a record. SQL Delete Command – DELETING SINGLE ROW FROM TABLE SQL delete command Statement Syntax: DELETE FROM TABLE_NAME WHERE SOME_COLUMN=SOME_VALUE EXAMPLE: […]

SQL – Show rows of a table using SELECT STATEMENT COMMAND

SQL is providing a command using which we can easily show or check rows of a table. SQL COMMAND TO SHOW ALL ROWS – SELECT STATEMENT In lots of situation, we may require to fetch all the rows. In simple language, we may need to see all the rows available in a table. For this […]

SQL – Update Data in a table using sql command (syntax)

Lots of situation may rise, where we may require to change data in a table. In SQL world, changing the value of data is known as update. We are updating information or data in a table. Why we need to update data in a table? Roll_no Student_name Subject Marks 1 John Math 90 2 Rita […]

SQL – Insert data into table using SQL command (Syntax)

After table creation, we are required to insert data into the table. SQL is providing another command using which we can insert data into table. Insert data into table using SQL Command: Before inserting data into table, we must have to careful otherwise we may end up encountering bank of errors. SQL Insert Command (Syntax): […]

SQL – Create table using syntax

Real job of programmer is to create table programmatically using SQL Syntax. Why we need to create table using Syntax? Previously, we have learned, how to create table through PHPMYADMIN. It is very easy. But it is not an efficient way to create table for following reason: In real time project, our table is going […]

SQL – Insert data into table using mysql interface

MySQL PHPMYADMIN interface has made easy to insert data into table. Lets see how we are going to insert data. We are going to insert values and for reference we have following pictorial representation of student marks table. Roll_no Student_name Subject Marks 1 John Math 90 2 Rita Math 95 3 Sam Math 84 4 […]

SQL – Create Table using MySQL Interface

In previous chapter, we have learned how to create database using mysql interface. In this chapter, we are going to learn how to create table using MySQL interface. If you remember, in previous when you have created the database, it asked to create table. Lets proceed. We are going to create following table in MySQL. […]

SQL – Create Database through MySQL Interface

Creating Database through MySQL interface is easy. For this we are going to use xampp. If you are not aware of xampp, and how to install it, then read following article. HOW TO DOWNLOAD AND INSTALL XAMPP IN WINDOWS AND MAC OS X? CREATING DATABASE THROUGH MYSQL INTERFACE: Step 01: Launch xampp. If you are […]

SQL – Datatypes

Good understanding of SQL Datatypes are important to better understand SQL Syntax. SQL Datatypes: For understanding purpose lets consider the following table. Roll_no Student_name Subject Marks 1 John Math 90 2 Rita Math 95 3 Sam Math 84 4 Jack Math 72 5 Pom Math 99 If you are new to SQL database and table, […]