How To Hide Category If Assoc. Item Field Is Empty
I have an index.asp page that displays my database items, along with their respective categories. The categories are an include page (left.asp). How can I hide the category if there aren't any items for that category? Here are the 2 pages below....
I have added a new field in my database for the news items, basically a boolean value (true or false) for the display or hide of a news article. I have simple added to my queries WHERE newsDisplay, and that does the job except now I have one query qhich is actually causing me a small problem, due to the query already having a where clause.
like below:
dbSelectQuery("SELECT * FROM tblNews WHERE newsID ORDER BY newsDate DESC")
So that leaves me a little puzzled as to going about this query which should solve the small issue, I was even thinking is there a way I can use an if operator. Something along the lines of if newsDisplay = true or checked then do something else. Someone must know. I just dont think you can actually use an if statement on a sql query? Any tips would be perfect . PS - The new field I have added is newsDisplay as a yes/no in an access database.
i want to count all the records in my database where a certain field is empty.
heres my statement: "SELECT Count(*) As Total FROM table WHERE field1='value' AND field2=' ' "
gives an error. If it not possible. can the next be done: 1 count all the records. 2 count the records where field2='Yes' 3 subtract the two to get where field 2 is empty?
i know it's just something small, but i can't seem to figure it out. i also tried field2 != 'Yes'
Just getting started with ASP (NOT .NET) and have a question:
I have a basic form and I'm trying to add some functionality to it. I want a user to be able to select a product from a list box. After this product is selected have another text box, ProductID update to reflect the product number.
In VB I would use an OnChange type thing. Can anyone point me how to do this with an ASP page or using some kind of embedded script?
I'm listing records from my db and each company has 3 address lines ie address, address2, address3. In most cases 3 and sometimes 2 are empty. As my ASP looks like this
then I end up with the first line of the address and two blank lines. How could I avoid that by checking if the fields have content, only then display them?
I so thought I had this down and I was getting excited, but when I ran it, it didn't work. I've tried a few different things and I can't get it to work (not smart enough I guess). Code:
I need to find out if "fldValPaid" hold anything. I will use it an IF ELSE statement. In payment table a particular record could exist or not. How do I find out by evaluating "fldValPaid" if any record exists or not. I have to find out using "fldValPaid" ...I can not use number of record/record return or any other method.
I've been searching for an answer to this for quite some time now and have found nothing, so maybe (hopefully) someone out there will be able to help me.
At my work, we have a lot of folders for different jobs we've done. And right now, we have more than one person making the folders for all the new jobs that we get. I am trying to make a database were it will only show the jobs that have not had folders made. In order to do this, I've created a field titled "Initials". I want the webpage to pull up all the records where the Initials field is empty, but I'm having trouble doing that. I've tried a few different things and have found no success.
I'm not having a problem accesses the database or updating it, just displaying the right information. I'll give a little illustration (because I'm never good with words):
Say I have 3 jobs: Job #1, Job #2, and Job #3. Someone has already made job folders for Job #1, but Job #2 and Job #3 still need to be made. Since Job #1 has been made, that means there are initials in the initials field of the database and thus, I do not want that Job being displayed on the "To Be Made" page. Job #2 and Job #3 do not have initials in the initials field and as such, I want to display those jobs....
I'm getting an error when I'm retreaving from a "text field" in the database and it has no data in it. I'm using MYSQL version 3.23.58-nt. I have the same script running a different system and I don't get this error. It justs output nothing and continues with the loop.
This has to be an ASP problem when retrieving data from the database. I've change the Field for Message to "varchar(252)" vice "text" in the database and stoped giving me error. But I still need to use the type "text" in the database since my "Message" will be longer then 252 caracter. Code:
I have an .asp page where I ORDER BY catagory. The catagory column has only three possible values; ICO, Negotiator, Product. I built the page using ORDER BY catagory. So, the order the list would be in is: ICO, Negotiator, Product. The owner wants the grouping to be: Negotiatory, ICO, then Product. How do I do an ORDER BY when it's neither ascending nor descending?
I am currently putting together an eCommerce site. I have almost everything in place, but I am not happy with the category system for our products.
There are around 2500 products in a SQL Sever db, each assigned 1 of 300 odd categories. Currently, I have statically built the category tree but wish to automate this task as it is becoming increasingly difficult to manage.
I have googled plenty of info, specifically for ADO data shaping. Is this the right route to take, especially considering each branch of the category tree may differ in depth of categories? How exactly do other eCommerce sites automate this task?
I would also want to be able to copy the category system that provides links to previously selected categories i.e.
Category 1 > Sub Category 2 > Sub Category 3 > etc etc
Is this possible with the SHAPE command? Are there other methods of performing this task?
I am particularly concerned about the database taking a major performance hit from all of these SHAPE queries, which would be required on every category page. Could I use a stored procedure, and how much would it improve performance? Considering I will be hosting on a shared server, I want to make this as efficient as possible.
I want to get the same working in ASP, when user click on the Main Category <list item> then in the <list item> only show the Sub-Categories of the related to Main Category. the example are shown in the above url, but this is in php.
I want to hide a submit button until all parts of the form are completed, the form contains 7 rows of radio boxes which are in groups(5 in each grp) when all are selected i want the button to appear but the page not needing to be refreshed, any ideas?
I migrated a mysql DB into a MSSQL DB. In this DB all chars like "blank" or @ are encoded in...whats it called in english? :) you know, when a blank is "+" or @ is "%40"... :) How do I resolve those "%20"s back into a readable character or a blank with asp? Plus: How do I convert blanks into + again to write them back into the DB.
I have an Invoice.asp page which displays the number of products ordered by size. I would like to make the 0 values invisisble on the page. Can any1 help? Below is some code that applys what i would like to do this using text fields.
<% If O("S4") = 0 Then txtValue4 = "" Else txtValue4 = O("S4") End If %>
"O("S4")" is the recordset name and "txtValue4" is the initial value of the textfield.
Does anyone know how to alter this piece of code so that it applys to only the recordset "O("S4")" and not the textfield, alowing me to get rid of the textfields?
What's the best method to hide, or not show a certain record when doing a pull from a database, as in I am pulling a list with a dozen category's and I don't what to show one of them.
I need to hide a drop down box. For a car search page, if the user selects "NEW" the mileage drop-down dissappears, but if the user selects "USED" than the mileage drop down appears. I need this on the server side, so I would be needing to use VBScript.
How can i make sure my ASP code is hidden on my web server when soebody accesses the ASP page? I want to do all I can to protect against this. The other day I was at a web page and instead of seeing the results of the page, the entire page was displayed to me as text and you couldd see all the asp code.
Is this posible? You wrap a javascript function around all of your ASP code, link it externaly, and simply call your function later. I wonder if this could be done?if yes, how about the performance. Does it stay the same?
I want to hide the web URL that gets displayed in the address bar every time we visit the web site, say first time we login and we get the url www.something.com. and next time when we navigate through the web site we also get the web page location and name on the address bar, is there a way to stop this and displaying only the starting web address www.something.com where ever we visit the web page form the current site, and with out using HTML FRAMES is there any login in this so that i can use it with any script language like javascript and vbscript.
im having a problem with one of my insert pages. On this page i have a form with a number of text fields, all these text fields must have an initial value of 0. Is there anyway of displaying these fields to show no value at all when in fact they have an initial value of 0.
Its very common to pass information from one page to another using asp through the address bar. It is also possible to hack the code if one notices this. I.e the price of the item.
I was hopping someone new a way which would either mask the address bar so it never changed from example it stayed static irrespective of the page the view is on. Or they must be another way.
I have a query that checks one field against another and the recordset is not displayed if they are equal. What I need is to hide a 'proceed' button if the recordset is empty.
i want to hide duplicate values of a column in a asp form, lets suppose i have a field schoolname, and studentname, so it is possible a school have so many studnets, so i dont want to show school name infront of each student name, how can i hide it,
Is there a way I can test if an image file exists before displaying it?
I have a database that has an image field in it that users enter a filename into. Is there a way for me to check using an "if" statement that the file is actually on the drive before displaying it? ie:
<%okimage=(rsFile.Fields.Item("image").Value) If okimage='actually on the drive' then%> <img src='(rsFile.Fields.Item("image").Value)'> <%else%> <img src='noimage.jpg'> <%end if%>