mysql query for null value

mysql query for null value

What mysql query for null value i need to write to display message when no data in database? Please help.
Thanks!

View Answers

March 21, 2012 at 1:06 PM

if(mysql_num_rows($data2) > 0){
    //while loop goes here 
 } else {
    //echo message
 }

To check if the object contain any value or not ..just compare it with zero. If the value for object is greater than zero display it otherwise you can throw any message using "echo". If Else is a great way to validate any object.
Thanks!









Related Tutorials/Questions & Answers:
mysql query for null value
mysql query for null value   What mysql query for null value i need...; if(mysql_num_rows($data2) > 0){ //while loop goes here } else { //echo message } To check if the object contain any value or not ..just
Output of null value
main(String [] args){ String str=null; System.out.println(str); } } Output value Null Description:- In the given example... a String variable and initialized it with null value
Advertisements
Mysql Alter Allow Null
Mysql Alter Allow Null       Mysql Alter Allow Null is used to change the Null Type of a column..._TO_REPLACE_1 The section of Tutorial illustrate an example from 'Mysql Alter Allow Null
Php Sql Null
Php Sql Null This example illustrates to describe about null value... field or column value to NULL it does not work properly. To handle this type... IS NULL: operator returns true of column value is NULL. IS NOT NULL
Mysql Alter Not Null
Mysql Alter Not Null       Mysql Alter Not Null is used to perform when we want records... with ExampleADS_TO_REPLACE_1 The Tutorial illustrate an example from 'Mysql Alter Not Null
Mysql Minus Query
Mysql Minus Query       Mysql Minus Query is used to return the calculated value from subtracting... The Tutorial illustrate an example from 'Mysql Minus Query'. To understand
Error in checking null value in string
Error in checking null value in string  Error in checking null value... in the following code: String registerno=null; registerno=request.getParameter("registerno"); int r=0; if(!registerno.equals(null)) /* Error line */ { r=1; } Can
Query to Test MySQL Performance
Query to Test MySQL Performance  Query to Test MySQL Performance
mysql query
mysql query  how do transfer into the excel data to my sql  ... with ("jdbc:odbc:excel"). Execute query "select name, address from [Sheet1$]". Here... the mysql connection in your php and store the list values inside the mysql
receiving null value in back bean by the jsf page
receiving null value in back bean by the jsf page  i have done above things but i m receiving null value in back bean by the jsf page plz tell me solution as soon as possible
Why string is storing null value - IoC
it is also storing null value in temp. WHY so...Why string is storing null value  I am reading lines from a file and then splitting it with " " as the criteria If line has first element null
select query in mysql
select query in mysql  Select query in mysql. Can anyone
Mysql Minimum Query
Mysql Minimum Query       Mysql Minimum Query is useful when you want to return... The Tutorial makes you understand an example from 'Mysql Minimum Query'.To elaborate
Mysql Minimum Query
Mysql Minimum Query       Mysql Minimum Query is useful when you want to return the minimum value... understand an example from 'Mysql Minimum Query'. To elaborate more on it, we
mysql query
mysql query  I have two tables namely sms and bdpaidbribe. I want to insert a column "Message" of sms table into "caddiinfo" column of bdpaidbribe table. and whenever the Message is inserted into sms table it should automatically
Timestamp value and query
Timestamp value and query  convert a string to timestamp and pass it into database settimestamp value We get a string from jsp.The string value is a date and time value. Convert the string value to a timestamp and a query
Difference between not null and primary key in mysql
Difference between not null and primary key in mysql  Explain not null and primary key in mysql
Spring Null value, Set null value in Springs configuration file
Spring Null value, Set null value in Springs configuration file In this example you will see how to set null value in the Spring configuration file... this application it will display output as shown below:     null
MySQL Coalesce
-null value of its arguments. Syntax: coalesce(value,..): It returns the first non NULL value in the list. If there are no non-NULL values then it returns... MySQL Coalesce      
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from...; ... <tr> <td><s:label value="Course " for="course...;s:if test="branchList != null"> <tr><td><s:select name
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from...; ... <tr> <td><s:label value="Course " for="course...;s:if test="branchList != null"> <tr><td><s:select name
getting null value in action from ajax call
getting null value in action from ajax call  Getting null value from...; ... <tr> <td><s:label value="Course " for="course...;s:if test="branchList != null"> <tr><td><s:select name
insert query in mysql
insert query in mysql  insert query in mysql not working   [INSERT INTO Birthdays(firstname, lastname, birthday, group) VALUES('Sam','Smith','June','Junior
getting null value in my class when using t:inputFileUpload
getting null value in my class when using t:inputFileUpload  getting null value in my class when using t:inputFileUpload
Where clause with query in MySQL
Where clause with query in MySQL  Hi, I want to learn the where clause in MySQL. Provide me the tutorials. Thanks   Hi, Here... | roy | NULL | 800
AND and OR Operators in MySQL Query
AND and OR Operators in MySQL Query  Hi, How to use the AND and OR Operators in MySQL Query? Thanks   Hi, We have a table with following... | 400 | | Ishu | roy | NULL
insert/update records with some of the columns having NULL value.
insert/update records with some of the columns having NULL value.  How do I insert/update records with some of the columns having NULL value
MySQL Boolean Value
'MySQL Boolean Value'. To understand the example execute a query 'SHOW TABLE...MySQL Boolean Value       MySQl Boolean Value is used to display the Boolean type status of the field
getting null value in my class when using t:inputFileUpload
getting null value in my class when using t:inputFileUpload  getting null value in my class when using t:inputFileUpload i have implemented all... changes in web.xml also still getting null value when i access in my bean Thanking
mysql query - WebSevices
mysql query  From your answer for my last post "SELECT * FROM roseindia WHERE age BETWEEN '20' AND '30' " If the age field... we compare with from and to ages?.  Hi... U May create your query
Clicking F5 and reentering value throws Null pointer exception
Clicking F5 and reentering value throws Null pointer exception  Hi, My page performs search operation.Normally when i enter a value and click... refresh my page and enter any value it is throwing Null pointer exception.can
Mysql Add Column Default Value
Mysql Add Column Default Value       Mysql Add Column Default Value is used to add the default value... for  Add Column Default Value The Query Alter is used
Mysql Minus Operator
; Mysql Minus Query  return the calculated value from subtracting the maximum value and minimum value. Query for creating table name Employee:ADS_TO_REPLACE_1 The Tutorial illustrate an example from 'Mysql Minus Query
MySQL Absolute Value
MySQL Absolute Value       MySQL Absolute Value is used to return the absolute value of a records... The Tutorial describes you to find the Absolute Value in MySQL. To understand
Null value when i set interface object in form controller - Spring
Null value when i set interface object in form controller   Hi all, i am very new about spring and hibernate. i got null value when i set... got NULL pointer exception ... please guide me if any one know ...it is very
PHP MySQL query
PHP MySQL query  I have 11 tables and have to do the CRUD operations keeping userid as a reference key
range of dates in mysql query
range of dates in mysql query  How to select the range of dates in mysql ..when i have to select from between & and of date function?   SELECT * FROM MAAccounts WHERE updatedOn BETWEEN ? AND ? ORDER
Function mysql_db_query() is deprecated
Function mysql_db_query() is deprecated  Hi, In latest version of PHP Function mysqldbquery() is deprecated. What could be the solution? Thanks
Function mysql_db_query() is deprecated
Function mysql_db_query() is deprecated  Hi, In latest version of PHP Function mysqldbquery() is deprecated. What could be the solution? Thanks
mysql query - WebSevices
mysql query  I have a field in database as DOB. But I want to search recrods as per "fromage" to "toage". I dont know how to compare the ages with DOB field and retrieve records. plese help me. in mysql with PHP  Hi
Mysql Date Query
Mysql Date Query       Mysql Date Query Date Query is used to return the current date, month and year... an example from 'Mysql Date Query'. To understand this example we use current
MySQL PHP Query delete
MySQL PHP Query delete       Mysql PHP Query delete is used to execute Mysql function ( ) delete query from a database table. MySQL PHP Query is used to delete the records
PHP Null Variables
PHP Null Variables PHP Null variable is a type that only stores the null value. The Null value indicates that the used variable has no value. The variable... In the above example we only compare the variable value with the null
MySql Databse query to fetch results from database
MySql Databse query to fetch results from database  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values... as single values like chennai as one value, trichy as one value. and i have
MySQL PHP Query delete
MySQL PHP Query delete       Mysql PHP Query delete is used to execute Mysql function ( ) delete query from a database table. MySQL PHP Query is used to delete the records
MySQL Blank Field
by the MySQL Query. In the table 'example' two t_count fields are blank and we find both field which has some value by query 'select * from example where t_count is not null' and find which field has null value by query 'select * from example where
MySql Absolute Value
MySql Absolute Value This example illustrates how to find the absolute value... in the sql query. In the given table the column emp_value define float type when... Query   select emp_value, abs(emp
MySQL Addition
MySQL Addition       MySQL Addition returns you the sum value of the total counts in a table. The Aggregate function is used to perform the calculation in SQL Query. We make use
The null keyword
. Assigning a null value to a non-primitive type variable releases... The null keyword       The null keyword in java programming language is a reserved word that is used
SQL NOT NULL Constraint
not insert any value to record ,the records shows you SQL NOT NULL... SQL NOT NULL Constraint       The NOT NULL constraint allows a column not to accept

Ads