mysql query for null value

Ads
 

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!

Ads









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 Minus Query
Mysql Minus Query       Mysql Minus Query is used to return the calculated value from subtracting... illustrate an example from 'Mysql Minus Query'. To understand and elaborate example we
Mysql Alter Allow Null
Mysql Alter Allow Null       Mysql Alter Allow Null is used to change the Null Type of a column... of Tutorial illustrate an example from 'Mysql Alter Allow Null'.To understand
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 of problem  MySQL provides three operators: IS NULL: operator
Mysql Alter Not Null
Mysql Alter Not Null       Mysql Alter Not Null is used to perform when we want records... The Tutorial illustrate an example from 'Mysql Alter Not Null'. 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
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
Query to Test MySQL Performance
Query to Test MySQL Performance  Query to Test MySQL Performance
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
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... understand an example from 'Mysql Minimum Query'.To elaborate more on it, we
Mysql Minimum Query
Mysql Minimum Query       Mysql Minimum Query is useful when you want to return the minimum value... an example from 'Mysql Minimum Query'. To elaborate more on it, we simply create
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
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
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
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
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 NULL... MySQL Coalesce      
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
MySQL Boolean Value
MySQL Boolean Value       MySQl Boolean Value is used to display the Boolean type status of the field... Value'. To understand the example execute a query 'SHOW TABLE STATUS LIKE "
MySQL Absolute Value
MySQL Absolute Value       MySQL Absolute Value is used to return the absolute value of a records... describes you to find the Absolute Value in MySQL. To understand the example we use
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
Mysql Add Column Default Value
Mysql Add Column Default Value       Mysql Add Column Default Value is used to add the default value... The Tutorial illustrate an example from 'Mysql Add Column Default Value
PHP MySQL query
PHP MySQL query  I have 11 tables and have to do the CRUD operations keeping userid as a reference key
Mysql Minus Operator
; Mysql Minus Query  return the calculated value from subtracting the maximum value and minimum value. Query for creating table name Employee: The Tutorial illustrate an example from 'Mysql Minus Query'. To understand and elaborate
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

Ads