Check if the table is empty
Hey,.
I want to make sure that if my MySQL table is empty users would receive "There is no information to display." in their browsers. Here's how I tried to do:
If (! mysql_query ("SELECT * FROM Table", $con))
{
echo "< b > there is no information to display." "< /b > < br / > < br / > ';
}
on the other
{
echo "< b > we have something to show you. "< /b > < br / > < br / > ';
}
Although MySQL table is empty, it returns "We have something to show you." as if there are records in the DB table.
Do I did wrong? Is there another way to check if the MySQL table is empty?
* BTW - I use UniServer.
See you soon,.
DissidentPJ
mysql_query only returns false in case of error. An empty recordset is not a mistake. Using a method of number of lines that you mentioned in your second post.
Tags: Dreamweaver
Similar Questions
-
Mr President.
I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?
the page source is
<?xml version='1.0' encoding='UTF-8'?> <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core"> <af:panelFormLayout id="pfl1"> <af:group id="Group"> <af:inputText value="#{bindings.VoucherId.inputValue}" label="#{bindings.VoucherId.hints.label}" required="#{bindings.VoucherId.hints.mandatory}" columns="#{bindings.VoucherId.hints.displayWidth}" maximumLength="#{bindings.VoucherId.hints.precision}" shortDesc="#{bindings.VoucherId.hints.tooltip}" id="it1"> <f:validator binding="#{bindings.VoucherId.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId.format}"/> </af:inputText> <af:inputDate value="#{bindings.VoucherDate.inputValue}" label="#{bindings.VoucherDate.hints.label}" required="#{bindings.VoucherDate.hints.mandatory}" columns="#{bindings.VoucherDate.hints.displayWidth}" shortDesc="#{bindings.VoucherDate.hints.tooltip}" id="id1"> <f:validator binding="#{bindings.VoucherDate.validator}"/> <af:convertDateTime pattern="#{bindings.VoucherDate.format}"/> </af:inputDate> <af:inputText value="#{bindings.Credit.inputValue}" label="#{bindings.Credit.hints.label}" required="#{bindings.Credit.hints.mandatory}" columns="#{bindings.Credit.hints.displayWidth}" maximumLength="#{bindings.Credit.hints.precision}" shortDesc="#{bindings.Credit.hints.tooltip}" id="it2"> <f:validator binding="#{bindings.Credit.validator}"/> </af:inputText> </af:group> <af:group id="g1"> <af:inputText value="#{bindings.Lineitem.inputValue}" label="#{bindings.Lineitem.hints.label}" required="#{bindings.Lineitem.hints.mandatory}" columns="#{bindings.Lineitem.hints.displayWidth}" maximumLength="#{bindings.Lineitem.hints.precision}" shortDesc="#{bindings.Lineitem.hints.tooltip}" id="it3"> <f:validator binding="#{bindings.Lineitem.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.Lineitem.format}"/> </af:inputText> <af:inputText value="#{bindings.VoucherId1.inputValue}" label="#{bindings.VoucherId1.hints.label}" required="#{bindings.VoucherId1.hints.mandatory}" columns="#{bindings.VoucherId1.hints.displayWidth}" maximumLength="#{bindings.VoucherId1.hints.precision}" shortDesc="#{bindings.VoucherId1.hints.tooltip}" id="it4"> <f:validator binding="#{bindings.VoucherId1.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId1.format}"/> </af:inputText> <af:inputText value="#{bindings.Debit.inputValue}" label="#{bindings.Debit.hints.label}" required="#{bindings.Debit.hints.mandatory}" columns="#{bindings.Debit.hints.displayWidth}" maximumLength="#{bindings.Debit.hints.precision}" shortDesc="#{bindings.Debit.hints.tooltip}" id="it5"> <f:validator binding="#{bindings.Debit.validator}"/> </af:inputText> <af:inputText value="#{bindings.Credit1.inputValue}" label="#{bindings.Credit1.hints.label}" required="#{bindings.Credit1.hints.mandatory}" columns="#{bindings.Credit1.hints.displayWidth}" maximumLength="#{bindings.Credit1.hints.precision}" shortDesc="#{bindings.Credit1.hints.tooltip}" id="it6"> <f:validator binding="#{bindings.Credit1.validator}"/> </af:inputText> <af:inputText value="#{bindings.Particulars.inputValue}" label="#{bindings.Particulars.hints.label}" required="#{bindings.Particulars.hints.mandatory}" columns="#{bindings.Particulars.hints.displayWidth}" maximumLength="#{bindings.Particulars.hints.precision}" shortDesc="#{bindings.Particulars.hints.tooltip}" id="it7"> <f:validator binding="#{bindings.Particulars.validator}"/> </af:inputText> <af:inputText value="#{bindings.Amount.inputValue}" label="#{bindings.Amount.hints.label}" required="#{bindings.Amount.hints.mandatory}" columns="#{bindings.Amount.hints.displayWidth}" maximumLength="#{bindings.Amount.hints.precision}" shortDesc="#{bindings.Amount.hints.tooltip}" id="it8"> <f:validator binding="#{bindings.Amount.validator}"/> <af:convertNumber groupingUsed="false" pattern="#{bindings.Amount.format}"/> </af:inputText> </af:group> <f:facet name="footer"> <af:button text="Submit" id="b1"/> <af:button actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert" disabled="#{!bindings.CreateInsert.enabled}" id="b2"/> <af:button actionListener="#{bindings.Commit.execute}" text="Commit" disabled="#{!bindings.Commit.enabled}" id="b3"/> <af:button actionListener="#{bindings.Rollback.execute}" text="Rollback" disabled="#{!bindings.Rollback.enabled}" immediate="true" id="b4"> <af:resetActionListener/> </af:button> </f:facet> </af:panelFormLayout> </ui:composition>
Concerning
Go to your VO Wizard, select the tab of the entity and to check if both the EO is editable or not.
See you soon
AJ
-
Select at least 1 rank, even if the table is empty
Hi all
I've got table t1:
My need is to select at least 1 rank, even if the table is empty, for example:with t1 as ( select 1 as column1, 't' as column2 from dual ) select * from t1
The problem is that I don't know the amount of columns and its data type. How can I make a dynamic query based on the current structure of table t1?with t1 as ( select 1 as column1, 't' as column2 from dual ) select * from t1 where rownum = 0 union all select 0 as column1, '' as column2 from dual
Hello
This looks like a job for an outer join:
SELECT t1.* FROM dual LEFT OUTER JOIN t1 ON 1 = 1 ;
Because it is not reference individual columns from t1, you do not need to know what are the columns it, or what their data types.
-
Check if the table contains a value
Hi all
I have a table in TestStand that contains numbers. Numbers are generated by a VI and are ranked randomly.
(1) how can I check to see if the number "6481" is in this table using a step of TestStand?
(2) is it possible to put this empty table in TestStand, and then complete the table to the size needed when the VI move back the numbers. (i.e. do the table to the size that the VI generates during execution)?
See you soon,.
Chase
I think you will be interested in this Jürgen!
I managed to do it in 'one step', using a loop.
-
How to check where the table field has been used as a foreign key in the database
Hi I have a field in my table Office I had office_code field, this field has been used in the tables of diffirent as foreign key is a sql I can wirte to see all the tables that have used this field as a foreign key
Edited by: adf009 09/05/2013 10:37
Edited by: adf009 09/05/2013 10:38Check this box
SELECT * FROM user_constraints WHERE table_name='EMP' and CONSTRAINT_TYPE='R';
Type = 'R' means referential integrity constraint type.
-
Insert rows checked in the table
Hi all
How to insert rows checked in another table. I've created an interactive report with the query as follows
Select apex_item.checkbox(1,id,'unchecked') ", Column1, Column2 from table. Now when I check the boxes to check off and hit the Insert button it should get stored in another table in DB (table1).
Process:
DECLARE
IDX number;
BEGIN
BECAUSE me in 1.APEX_APPLICATION. G_F01. COUNTY
LOOP
IDX: = apex_application. G_F01 (i);
Insert into step3_table (ID, TASK_NAME, TASK_DESCRIPTION, CATEGORY, TASK_INFO, TASK_STATUS, TO_WORKGROUP, IMPACT, FILE)
values (apex_application. G_F02 (idx), apex_application. G_F03 (idx), apex_application. G_F04 (idx), apex_application. G_F05 (idx), apex_application. G_F06 (idx), apex_application. G_F07 (idx), apex_application. G_F08 (idx), apex_application. G_F09 (idx), apex_application. G_F10 (idx));
END LOOP;
END;
Thanks for the help!Hello
You don't have a F02 - F04 berries in your query.
Even you, your insert statement do not have enough source columns.
Also I do not know you could get all the data tables in this way... table F01 value maybe not array index value.Try
BEGIN FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP INSERT INTO step3_table (ID,TASK_NAME,TASK_DESCRIPTION,CATEGORY,TASK_INFO,TASK_STATUS,TO_WORKGROUP,IMPACT,FOLDER) SELECT id,column2,column2,column3,column4,column5,column6,column7,column8 FROM table WHERE id = apex_application.G_F01(i) ; END LOOP; END;
Kind regards
Jari -
Rows in the table is empty when you import Excel
Each month, I need to import Excel spreadsheets into an HTML page 'Nine', before you paste the part of the text in an existing page.
Part of my procedure is to remove the outside (with data) lines on the worksheet prior to importation. In design, the display, I import it seems to work and each resulting table has just the right number of lines. Then I do some find and replace, and copy the code I want in the existing page in Code view.
When I change code mode, I find a lot of empty lines (with the same number of cells, such as active lines) in each set of active lines I pasted. Because of the amount, withdrawal of these code view is time and frought with error (I could delete the active lines in the next game). I think this artifact has started when I upgraded to CS5 in CS3. Is there a way that I do not have these lines? If this isn't the case, could set the agenda so that the number of lines in code view corresponds to the number in design mode?
Hello Terry,
Without worker point I copy and paste about 23 rows of 8 columns of 5 different pages in Excel 5 different tables in DW5.5 every week.
Honestly, it takes less than a minute for each is in a total view of 2.5 minutes.
-
Running a Script Date, check if the field is empty
I have a Date Script
var f = this.getField ("WeekEndDate");
var d = new Date (f.value);
d.setDate (d.getDate () - 6);
Event.Value = util.printd ("mm/dd/yyyy", d);
It works fine, but when the registered name of 'WeekEndDate' is empty you get error messages. I was hoping to adjust the script as well as to WeekendDate.length == 0 if would be white submitted were the script is located and if WeekendDate.length > 0, he would run the above script, but I don't know how. Can someone help me please
Try this:
var sDate = getField("WeekEndDate").valueAsString;
If (sDate) {}
var d = new Date (sDate);
d.setDate (d.getDate () - 6);
Event.Value = util.printd ("mm/dd/yyyy", d);
} else {}
Event.Value = "";
}
-
How to check the table (null / not null) on the screen?
Hello all :)
I am beginner in JDEV
I have problem with table.
When you view the table, I want to know if the existing data in the table are empty or not (check the query zero / non-zero)? How to do
someone help me... :))
THX
agungdmtHello
If you use ADF BC, access the iterator and call getEstimatedRowCound
Table richeTableau = get JSF component binding to table
TableBinding JUCtrlHierBinding = (JUCtrlHierBinding) (table.getValue ()) .getWrappedData ((CollectionModel));
DCIteratorBinding iter = tableBinding.getIteratorBinding ();int count = iter.getEstimatedRowCount ();
You can do the same thing in EL
#{bindings.iteratorName.estimatedRowCount > 0}--> true if given
Frank
-
Help for the reconciliation of the table in a sequence
I need assistance with the values of an array 1 d of channels read. Table 1 d of strings contains the names of the columns in a different table.
This must be included in a file, but only once. IM is able to do, but the only problem, the table 1 d of strings contains the previously stored values.
These values are from a list box, which is frozen as soon as the user clicks on the button OK/START in VI. I would like to print the values of frozen listbox, but it prints the values of the unfrozen ListBox instead.
The problem is clear to me, I should create an empty array of strings and stores this value, but where in the order this is done?
I have attached the VI, 'Header' is the table I'm talking about.
Thank you
Eureka
Solved!
I tried to complete the tables of empty strings in the header sub - VI writing and it works!
Thank you
Eureka
-
I have a Gr_order table that was settled long ago, and now he needs to be filled
with some more search data.
"Orderid" is a primary key for the table, but the question is how can I insert "orderid" in the insert statement in the procedure. I couldn't find any name sequence. There are 1230
documents that must be inserted.
Desc Gr_order Orderid Number Primary key Desc Varchar2
Thank youINSERT INTO gr_order (orderid,desc) VALUES (???, upper(each_pom.desc);
SandyYou can find the code that inserts into the table and see if it uses the sequence ;-). A sequence is not 'attached' to a particular table - this is the insert statement to determine whether a sequence should be used.
You can check if the table has a trigger - some developers like to emulate the behavior of MS - sql server by having a trigger on the table that selects in a sequence. If it has such a release, then you just do your insertions without specifying order_id. But if the table does not have such a release, then you cannot know if the table was originally filled using a sequence or not (unless you can find the instructions for inserting somewhere).
-
How to extract the data in the table in the database
Hi all
IM using PHP/MySQL and I use implode () function to store several values of checkboxes that have been selected in the form. Does store the word 'Table' in my database. How can I get back all of each data I've been record before (each of the checked instead of the word Array value)?
If you don't have that in the database is the Word table, that's all you'll get back out. It sounds like you do not store the information correctly.
Let's say that your form contains a series of checkboxes, all are called options. For all values, you must add square brackets after the name in the form:
Sun roof
Satellite navigation
Air conditioningIf the form is submitted using the POST method, the values will be stored in an array called $_POST ['options']. To store in the database, you must check whether the table exists and then use implode ():
if (isset($_POST['options'])) { $options = implode(',', $_POST['options']); } else { $options = ''; }
Then insert $options into the database.
-
Check if all the instances of a field in a table are empty?
I'm having a problem with the control if all instances of a field in a table are empty. If one is empty I need a message box appears. There is a header line and a line of body with several text fields. The line of the body is set to repeat itself and there are buttons to add and remove lines of the body.
I had success by checking if all fields are blank in the original line by using the following code:
if ((this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == null | )) this.resolveNode("Page1.Table1.Row3.TextField1").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField2").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField3").rawValue == "") || (this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == null | ) this.resolveNode("Page1.Table1.Row3.TextField4").rawValue == ""))
{xfa.host.messageBox ("Please complete the table of assessment/implementation." )} , 'Incomplete form' , 1);}
I guess that in all cases be verified that I have to use the 'resolveNodes' function but I could not make it work. That's what I tried:
if (( == this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue null | )) this.resolveNodes("Page1.Table1.Row3.TextField1").rawValue == "") || .........)
Although it works not since .rawValue isn't a function that work with resolveNodes (only resolveNode).
Should what code I use for this?
Thanks in advance for any advice.
Hello
To be able to check each field in a multiple instances of a table line, you must specify which line you are trying to access to...
To do this, you must specify the index of the row, this way you can treat each rows in a loop and access each field within this line
Instead of using resolveNodes, I suggest you use resolveNode... and it should look like this:
for (var i = 0; i)< page1.table1._row3.count;="">
If (this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]").) TextField1.rawValue == null | this.resolveNode ("Page1.Table1.Row3 [" + I.ToString + "]"). TextField2.rawValue | .......) {
xfa.host.messageBox ("Please complete the table of assessment/implementation.", "incomplete form", 1);
break;
}
}
I hope this helps!
-
Check for the empty table row before adding the date
On the form below, when I click on the green button (extreme right) plus a new row in the table is created with today's date. the user can then enter more text to the right of the date. Problem is when the form is saved and reopened, the text that the user entered is removed and today new is added because it is in the intialize event. How do I script to check and make sure that each dated line is empty before you add today's date?
https://Acrobat.com/#d=qTINfyoXA-U6cDxOGgcSEw
Thank you
~ Gift
Hi Don,
One possibility would be to use the box caption of the textfield for the date and leave the value part free for the user to enter their data:
if (xfa.resolveNode("this.caption.value.#text").value === "") { this.caption.value.text = util.printd("[mm/dd/yy] ", new Date() ); }
See here: https://acrobat.com/#d=VjJ-YsXLKmV6QU84JrAAIw.
Hope that helps,
Niall
-
Scan of the columns in table for empty cells
I have prepared a form that will do the following (Please bear with me for the description):
The form opens with a table of 10 rows. The user must enter sides (from 0 to 10) in one of the columns in the table. Once the user enters all the ratings of ten, he or she must then click a button to turn on the rest of the form (which is hidden). What I'm trying to do is, after the button is clicked, scan the table to ensure that the entire column was filled with a number. If the column was made, then a second page. If a cell in the column was left in white, then I want a prompt to appear and indicate to the user which cell is empty. I was able to run by using the following code:
This code is under the event 'click '.
If (decisionMatrix.dMTable.Row4.rating.rawValue is nothing)
{
Poster a warning prompt that indicates the form is incompletexfa.host.messageBox ("incomplete form. Please fill in the background. ","warning ", 3);
}
on the other
{
Allow the user to save the current state of the form and activate the second part of the form.
app.execMenuItem ("SaveAs");
}The problem with the above method is that it checks only the Row4 cell. I have to add more code for the other 9 rows in the table and for each message box, indicating to the user which field to fill. Is there a better way to do it? A switch-case perhaps statement?
I have also considered the column full analysis at a time and just using a message box general for the table, using the following code:
If (decisionMatrix.dMTable.Row [*].rating.rawValue is nothing)
{
Poster a warning prompt that indicates the form is incompletexfa.host.messageBox ("incomplete form. Please fill all of the scoring. ","warning ", 3);
}...
But it doesn't seem to work. Any help is appreciated. Thank you.
The seal contains a table with 10 rows and 3 columns (a_, b_ and c_). The calls button 'Continue' by clicking on the click event, which runs through the table looking for NULL values in each column per row. The "ratingMissing" flag controls the visibility of the page 2.
Form1.Page1.Subform1.continueBtn::click - (JavaScript, client)
var ratingMissing = false;
for (var i = 0; i)< 10;="" i++)="">
var line = i + 1;
If (xfa.resolveNode("form1.page1.subform1.table.row["_+_i_+_"].a_").rawValue == null) {}
xfa.host.messageBox ("A is missing in row"+ row);
ratingMissing = true;
}
If (xfa.resolveNode("form1.page1.subform1.table.row["_+_i_+_"].b_").rawValue == null) {}
xfa.host.messageBox ("B is not in the line" + row);
ratingMissing = true;
}
If (xfa.resolveNode("form1.page1.subform1.table.row["_+_i_+_"].c_").rawValue == null) {}
xfa.host.messageBox ("C is missing in the row" + row);
ratingMissing = true;
}
}
If (ratingMissing == false) {}
Form1.Page2.presence = "visible";
}
else {}
Form1.Page2.presence = 'hidden ';
}
Steve
Maybe you are looking for
-
[Linux] How can I see if there are new messages without opening Thunderbird?
Hi people I am working on Linux Fedora (20) and wonder if there is a way to see if I have new emails without opening Thunderbird again. I usually minimizes Thunderbird and when a new message arrives, I get a notification from the office, which is gre
-
I had a Library/Startupitems error since update my software HP a couple of years ago. Trying to finally solve this problem myself, the HP site suggested to remove and reinstall the software. There are no active link in the pages of HP support for a
-
Qosmio G40-108-dvd/video playback quality
You just bought the Qosmio G40 - 108 loaded with Vista Ultimate. EAD all reports and went for the superb view report. I am very disappointed by the quality of playback on DVD and avi (divX, Xvid, h264). The colors are bland bland and not all that sha
-
Games crashing in 64 bit 7 Ultimate causing same problems Age of Empires 3 and Company of heroes
Hello I have recently upgraded to 64-Bit 7 Ultimate and manage with 2 games. The first being Age Of Empires 3 the second being Company of heroes. The games begin and will be launch to between 2 to 15 minutes then crash to the windows desktop. After t
-
Cannot close a window on my desktop
I have a window open on my desktop that I can't close. It happened when I downloaded Google Earth. This downloaded fine, but when the user agreement came on the screen for a reason he couldn't display this Web page. So now I find myself with a window