Dificulty in displaying results from 2 tables

Hi Experts,
I have created a form that needs to display 2 different tables in the form. However, the second table only shows the results after all the records from the first are listed. I need to show both the tables in page 1 and continue to show the records in the succeeding pages. I have put the tables each in their different subforms and enclosed them in another subform but the entries from table 2 still does not show. Could you tell me what am I missing?
Thanks and more power.
Regards,
Rare

Hi,
What is the cardinality of the nodes that these tables are mapped to?
Is it 1..n or 0..n?
If it is 0..n then this is where the problem may be..
Try setting the minimum count of the second table to 1 in the binding tab in the livecycle designer..
Also, make sure the paginatinof the two sub forms is set to Flowed..
Hope this helps.
Rgds, Amith

Similar Messages

  • Display image from table!

    Hi,
    I have in my aplication a table user, where we can save is image:
    t_user{id_user, name , adress..., foto(blob),foto_size(number),foto_name,foto_mime_type};
    An user can upload his imageand save it in his table!
    I wanted to display his image, but i onle found infomation how to show images saved in htmldb_application_files:
    how to display image from tables?
    Thank's in advance

    Look at the sample application. It shows you how to do this

  • Trouble displaying results from a database call

    Hi Everyone,
    I have written a JSP page that sends and receives information to a MySQL database. It is not completely functional unfortunately. The first section of the page that is responsible for updating a database table works fine. However when I go to retrieve information from the same database table something is going astray.
    I feel that I am doing something wrong with regard to the ResultSet object. Please see the bottom of the code section below. Ultimately this code only displays beach_percent as Zero, no matter how many entries there are in the database table for the corresponding value of Beach & Sea Stamps.
    <%@ page import="javax.servlet.*" %>
    <%@ page import="javax.servlet.http.*" %>
    <%@ page import="java.sql.*" %>
    <%
         Connection connect = null;
         Statement state = null;
         ResultSet rs = null;
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         String password = "theOne";
         String url = "jdbc:mysql://localhost/survey_database";
         String user = "David";
         connect = DriverManager.getConnection(url, user, password);
         state = connect.createStatement();
         if(request.getParameter("radiobutton") != null)
              String enter_text = "insert into craft_survey values('";
              enter_text = enter_text.concat(request.getParameter("radiobutton"));
              enter_text = enter_text.concat("')");
              rs = state.executeQuery(enter_text);
         else
              pageContext.forward("craftSurvey.jsp");
         rs = state.executeQuery("SELECT stamp FROM craft_survey");
         int beach = 0;
         int bear = 0;
         int christmas = 0;
         int country = 0;
         int easter = 0;
         int faux = 0;
         int floral = 0;
         int heart = 0;
         int phrase = 0;
         int special = 0;
         int total = 0;
         while(rs.next())
              String type = rs.getString("stamp");
              if(type.equals("Beach & Sea Stamps"))
                   beach++;
                   total++;
              else
              if(type.equals("Bear & Cuddly Stamps"))
                   bear++;
                   total++;
              else
              if(type.equals("Christmas Stamps"))
                   christmas++;
                   total++;
              else
              if(type.equals("Country & Garden Stamps"))
                   country++;
                   total++;
              else
              if(type.equals("Easter Stamps"))
                   easter++;
                   total++;
              else
              if(type.equals("Faux Postage"))
                   faux++;
                   total++;
              else
              if(type.equals("Floral Stamps"))
                   floral++;
                   total++;
              else
              if(type.equals("Heart & Romance Stamps"))
                   heart++;
                   total++;
              else
              if(type.equals("Phrase & Wording Stamps"))
                   phrase++;
                   total++;
              else
              if(type.equals("Special Occasion Stamps"))
                   special++;
                   total++;
         int beach_percent = 0;
         int bear_percent = 0;
         int christmas_percent = 0;
         int country_percent = 0;
         int easter_percent = 0;
         int faux_percent = 0;
         int floral_percent = 0;
         int heart_percent = 0;
         int phrase_percent = 0;
         int special_percent = 0;
         if(beach > 0)
              beach_percent = (beach / total) * 100;
         if(bear > 0)
              bear_percent = (bear / total) * 100;
         if(christmas > 0)
              christmas_percent = (christmas / total) * 100;
         if(country > 0)
              country_percent = (country / total) * 100;
         if(easter > 0)
              easter_percent = (easter / total) * 100;
         if(faux > 0)
              faux_percent = (faux / total) * 100;
         if(floral > 0)
              floral_percent = (floral / total) * 100;
         if(heart > 0)
              heart_percent = (heart / total) * 100;
         if(phrase > 0)
              phrase_percent = (phrase / total) * 100;
         if(special > 0)
              special_percent = (special / total) * 100;
    %>
    <html>
    <head>
    <title> Craft Stamp Survey Results </title>
    </head>
    <body background="#ffffff">
    <h1> Craft Stamp Survey Results </h1>
    <table width="100%">
         <tr align="center">
         <td><img src="green_bar.jpg" height="20" width="<%=beach_percent *3%>"></td>
            <td>Beach & Sea Stamps</td>
            <td><%=beach_percent%></td>
    </tr>
    </table>
    </body>
    </html>Any help with getting this page to display anything other than zero will be great appreciated.
    Thanks
    David

    Hi,
    One reason could be of spaces .Before checking in the loop use trim function on the data retrieved from the database. You can also debug using System.out.println.
    Also just a suggestion - it is always a good coding practice to declare the variablse outside the loop. Don't declare the variables within a for loop.

  • Help, how to open and display blobs from tables

    Dear all,
    I am trying to store ms-word files on a table using a blob column.
    Does anyone how to open the files and display them from a form using 9iAS?
    Thank you.
    Carlos.

    And there may be, but you won't likely find that here. Do some time searching Google and maybe you'll find code that someone was nice enough to make freely available, although I wouldn't count on it. Were i a programmer and took the time to read those docs and write the code, I'd want to be paid for my time. But there are a lot of programmers who swear by freeware! You may get lucky.

  • Urgent:display result from JTable

    need help making the following in my code work:
    1.how do i display the whole table in my code using a dialog box or JOptionPane.
    2. i want to display a message beneath the table show the total price of items selected from the JComboBox .
    3.is there any way i could add a method or sommething that display detail of each item seleted from the list in a seperate column of the JTable in my code.say for instance,if i selects beans,1 cup, 100 and it display protein in a seperate column in the JTable.
    Thanks in advance.
    my code:
    '\n'
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    import java.util.*;
    public class BreakFast extends JFrame implements ActionListener{
         private JList ingredient;
         private JTable table;
         private DefaultTableModel model;
         private JButton move;
         private String[] food;
         private JComboBox box,box1;
         private String[] units;
         private double[] price={100,150,200,250,300,350,400};
         private JButton finish;
         public BreakFast(){
              Container c=getContentPane();
              c.setLayout(new FlowLayout());
              food = new String[] {"Corn Flakes","Beans","Shredded Bread","Mushroom",
              "eggs","Milks","Butter","Sugar","water","Oil"};
              ingredient = new JList(food);
              ingredient.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
              ingredient.setVisibleRowCount(4);
              JPanel p = new JPanel();
              p.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
              move = new JButton(">>>");
              move.addActionListener(this);
              //meal = new JTextArea(5,20);
              //meal.setEditable(false);
              p.add(new JScrollPane(ingredient),"Wast");
              JPanel p2 = new JPanel();
              p2.setBorder(new BevelBorder(BevelBorder.RAISED));
              units = new String[]{"2 cups","3 cups","4 cups","5 cups","1 mudu","2 mudu",
                        "3 mudu","4 mudu","5 mudu","6 mudu","7 mudu","8 mudu","9 mudu",
                        "1 bag"};
              box = new JComboBox(units);
              box.addActionListener(this);
              box1 = new JComboBox();
              //box1.setEditable(true);
              box1.addActionListener(this);
              for(int i=0;i<price.length;i++){
                   box1.addItem(price);
              model = new DefaultTableModel();
              //model.addColumn("No.");
              model.addColumn("Food Items");
              model.addColumn("Units");
              model.addColumn("Price");
              table = new JTable(model);
              JScrollPane pane = new JScrollPane(table);
              pane.setPreferredSize(new Dimension(350,100));
              finish = new JButton("Finish");
              finish.addActionListener(this);
              p.add(box,"West");
              p.add(box1,"Center");
              p.add(move,"East");
              p2.add(pane,"North");
              p2.add(finish,"South");
              c.add(p);
              c.add(p2);
              setSize(450,300);
              setVisible(true);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void actionPerformed(ActionEvent e){
         Object[] value = ingredient.getSelectedValues();
         if(e.getSource() == move){
         for(int i=0;i < value.length;i++){
         String word = (String)value[i];
         Vector<Object> data = new Vector<Object>();
         data.addElement( word );
    data.addElement( box.getSelectedItem() );
    data.addElement( box1.getSelectedItem());
         model.addRow( data );
         if(e.getSource() == finish){
              JOptionPane.showMessageDialog(BreakFast.this,table,"Selection Summary",JOptionPane.PLAIN_MESSAGE);
              System.exit(0);
         public static void main(String[] arg){
              new BreakFast();

    Multi-Post:
    http://forum.java.sun.com/thread.jspa?threadID=5122371&tstart=0
    Ignored.

  • HELP! Displaying results from a database in table format

    I'm developing a web application that will use a considerable number of database queries that need to be displayed back to the web-browser in HTML table format.
    I have been told that that result sets can allow tables to be built automatically without having to write the same loop and display code over and over.
    So far I have a HtmlResultSet class as follows:
    import java.sql.*;
    public class HtmlResultSet {
    private ResultSet rs;
    public HtmlResultSet(ResultSet rs) {
    this.rs = rs;
    public String toString() {  // can be called at most once
    StringBuffer out = new StringBuffer();
    // Start a table to display the result set
    out.append("<TABLE>\n");
    try {
    ResultSetMetaData rsmd = rs.getMetaData();
    int numcols = rsmd.getColumnCount();
    // Title the table with the result set's column labels
    out.append("<TR>");
    for (int i = 1; i <= numcols; i++) {
    out.append("<TH>" + rsmd.getColumnLabel(i));
    out.append("</TR>\n");
    while(rs.next()) {
    out.append("<TR>"); // start a new row
    for (int i = 1; i <= numcols; i++) {
    out.append("<TD>"); // start a new data element
    Object obj = rs.getObject(i);
    if (obj != null)
    out.append(obj.toString());
    else
    out.append(" ");
    out.append("</TR>\n");
    // End the table
    out.append("</TABLE>\n");
    catch (SQLException e) {
    out.append("</TABLE><H1>ERROR:</H1> " + e.getMessage() + "\n");
    return out.toString();
    I also have created a class that includes an instance of the class above to display the results, as follows:
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class customerLookup2 {
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    try{
    Class.forName("org.gjt.mm.mysql.Driver");
    con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sandywalker");
    out.println("<html>");
    out.println("<head><title> Users</title></head>");
    out.println("<body> Customers");
    HtmlResultSet result = new HtmlResultSet ("SELECT * FROM USERS");
    out.println("</body></html>");
    catch(ClassNotFoundException e ) {
    out.println("Couldn't load database driver: " + e.getMessage());
    catch(SQLException e) {
    out.println("SQLExeption caught: " +e.getMessage());
    finally {
    try {
    if (con !=null) con.close();
    catch (SQLException ignored) { }
    I keep getting a compile error "customerLookup2.java": Error #: 300 : constructor HtmlResultSet(java.lang.String, java.sql.Connection) not found in class HtmlResultSet at line 42, column 34".
    Can anyone shed any light on this.

    Looks like you are passing a string (SELECT * FROM USERS) instead of passing a ResultSet. Try passing a Resultset.

  • Display results from dynamic query created and executed inside procedure

    Hi;
    I have created this code:
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, VAR3 IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    end RunDynamicQuery;
    How can I run this procedure and see the result on the dymanic query generated inside it?
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Expected Output for this given example:
    20-05-2009 11:04:44 ( the result of the dymanic query inside the procedure variable MainQuery :='select sysdate from dual';)
    I tested with 'execute immediate':
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, filter IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    execute immediate (MainQuery );
    end RunDynamicQuery;
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Output:"Statement processed'' (no sysdate displayed ! )
    Please consider that the collums in the query are always dynamic... PIPELINE Table would not work because I would need to define a container, example:
    CREATE OR REPLACE TYPE emp_tabtype AS TABLE OF emp_type;
    FUNCTION RunDynamicQuery (p_cursor IN sys_refcursor)
    RETURN emp_tabtype PIPELINED
    IS
    emp_in emp%ROWTYPE;
    BEGIN
    LOOP
    FETCH p_cursor
    INTO emp_in;
    EXIT WHEN p_cursor%NOTFOUND;
    PIPE ROW (...)

    That would be a nice solution, thanks :)
    ''For now'' I implemented like this:
    My dynamic query now returns a single string ( select col1 || col2 || col3 from bla)
    This way I don't have dynamic collumns issue, and from business side, this ''string'' format works for them.
    This way I can use the pipelines to get the result out...
    OPEN myCursor FOR MainQuery;
    FETCH myCursor
    INTO myRow;
    WHILE (NOT myCursor%notFound) LOOP
    PIPE ROW(myRow);
    FETCH myCursor
    INTO myRow;
    END LOOP;
    CLOSE myCursor;

  • Line item display problem from table

    Hi experts......
    I am strucked up in my report  with a problem ,
    document no.(BELNR)  for corresponding bkpf has four line item  in BSEG table,
    BUZEI                      GJAHR  BUZEI   KOART  DMBTR           HKONT                                            
    9000000078     2006     1     S    200,600.00        0000500100     
    9000000078     2006     2     S    24,072.00          0000301500     
    9000000078     2006     3     S    481.00               0000300450     
    9000000078     2006     4     D    225,153.00        0000209800     
    My requiremet is that
    ========================
    when it goes inside the loop
    i want to display the belnr where Hkont  = '000500100'
    and koart = 'D', that will be 001 line item (buzei) and  0004 Buzei in this case.
    ie my output should be like
    ============================
    GROSS        NET
    200,600.00  225,153.00
    If i specify  and hkont = '000500100'and koart = 'D'. its not getting inside the select itself
    if i select without the where condition and hkont = '000500100'and koart = 'D' its going inside...
    Can you please help me out....
    My codings
    elect bukrs belnr  gjahr xref1 xref2  kunnr  buzei dmbtr hkont koart from bseg into corresponding fields of table it_bseg
                                              for all entries in it_bkpf
                                               where  bukrs = it_bkpf-bukrs
                                                      and belnr = it_bkpf-belnr
                                                      and gjahr = it_bkpf-gjahr
                                                      and hkont = '000500100'
                                                      and koart = 'D'.
    loop at it_bseg into wa_bseg .
       wa_final-kunnr = wa_bseg-kunnr.
       wa_final-xref1 = wa_bseg-xref1.
       wa_final-xref2 = wa_bseg-xref2.
        wa_final-DMbtr = wa_bseg-dmbtr.

    hi ...
    thanx a lot fo your reply,....
    thats wat i thought and was trying to do so.....
    and modified...can you please look in to the code....
    but wa_final-gross = wa_amount-dmbtr.
         wa_final-net = wa_amount-dmbtr.
    value is not getting populated ....i dont know the reason
    IF it_bseg[] is not initial.
    select  bukrs belnr gjahr dmbtr from bseg into corresponding fields of table it_amount
                                    for all entries in it_bseg
                                     where bukrs = it_bseg-bukrs
                                     and belnr = it_bseg-belnr.
    endif.
    if it_amount[] is not initial.
    select  kunnr  name1 LOCCO from kna1 into corresponding fields of table it_kna1
                                          for all entries in it_bseg
                                            where  kunnr = it_bseg-kunnr and
                                                   locco = pr_locco.
    endif.
    sort it_bseg by belnr.
    loop at it_bseg into wa_bseg .
       wa_final-kunnr = wa_bseg-kunnr.
       wa_final-xref1 = wa_bseg-xref1.
       wa_final-xref2 = wa_bseg-xref2.
    read table it_amount into wa_amount  with key belnr = bseg-belnr.
    if sy-subrc = 0.
    if wa_bseg-hkont = '000500100'.
    wa_final-gross = wa_amount-dmbtr.
    endif.
    if wa_bseg-koart = 'D'.
    wa_final-net = wa_amount-dmbtr.
    Endif.
    at end of belnr.
    Endat.
    Endif.

  • Trying to display results from access database query on a JSP

    Seem to be having real difficulty with this one, i keep getting a null pointer exception :(. Wondered if anyone could point me to any examples of displaying the results on jsp. The database is connected, as i can display the query on netbeans, but just not on a jsp.

    I think it would be good if we had a section in these forums for pre-canned answers to the same questions that come up again and again. It would save time.
    Here is a rough outline for using JSP:
    * Read a JSP book.
    * The JSP page (View in MVC) should get all the data it needs to display from a useBean and/or request.getAttribute().
    * The JSP page should not have any business logic. Its purpose is to display data only (and have some submit buttons such as 'update').
    You can do some basic client side validation using javascript if you want. Because there is no business logic in it, you can easily debug
    your code in the servlet or business logic. You can't set breakpoints in JSP and examine data easily.
    * When you click the submit button, all data from <input type="text" tags, etc is put into request scope via name/value pairs.
    * Submit the JSP page <form tag to a servlet (Control in MVC).
    * The servlet reads the name/value pairs of data from the JSP page via request.getParameter()
    * The servlet should then instansiate a business object (Model in MVC), passing the data it got from the page to the business logic.
    Example: ProcessPage processPage();
    if(request.getParameter("updateButtonClicked"))
    processPage.updateData(data from the jsp page)
    * The business logic should instansiate a separate database object (DAO) to get data to/from the database. Business logic should not have sql in it.
    Business logic should not generate html. Business logic should not have request objects in it.
    * The business logic should return data to the servlet that in turn will put it in request scope via request.setAttribute() so the JSP page can draw itself.
    * The servlet should then call up the approprate JSP page.

  • Multiple Results from Table

    Hello,
    my EJB Query hast multiple Results.
    My Table:
    key | value
    01  | test1
    02  | test2
    My Selection:
    select Object(b) from PhoneBookEntityBean b
    What kind of result type must the finder method have and how can i handle it?
    Thanks for help and ideas,
    André

    Hi
    I'm having problem with my finder method also...
    I have a finder with name findByEmpName in which I pass string “empname” as parameter, for this I have put following in my ejb-jar.xml:
         <query>
              <query-method>
                   <method-name>findByEmpName</method-name>
                   <method-params>
                        <method-param>java.lang.String</method-param>
                   </method-params>
              </query-method>
              <ejb-ql>select object(b) from TestEntityBean b where b.empName like ?1</ejb-ql>
         </query>
    and inside persistent.xml
         <finder-descriptor>
              <method-name>findByEmpName</method-name>
              <method-params>
                   <method-param>java.lang.String</method-param>
              </method-params>
              <load-selected-objects/>
         </finder-descriptor>
    but when I use this finder method in my jsp, it return me null (no rows) but corresponding row is present in the database, findByPrimaryKey and create are working fine...
    Is any other setting need to be done?? pls help!!
    ~Raj

  • Smart forms not displaying result from sub routine

    I am working on a smart form and need to display the description of the fabric code. Under Form Routines, I create a sub routine
    FORM fcc_values USING gv_fabrictext.
    which is supposed to store the description in gv_fabrictext. GV_FABRICTEXT has been declared in global data as char64. Then I call prior to displaying my table as
    perform fcc_values using gv_fabrictext.
    And then insert the field &gv_fabrictext& in cell but this does not display any result
    I know for sure that this sub routine works as I have tested it separately as a test program. Any ideas?

    1. put break point at ssf_function madulename and check field value.
    or
    2 fm_name export parameter ur not mentioned
    or
    3 global variable not defined properly
    go through above. still if u didnt get
    need program where the problem to find.
    Message was edited by:
            Deepa KN

  • Want to display results from database pagewise ?

    I have 500 records in the sql server 2000 then i query and retrieve them in a resultsets. and then i want to display 10 records per page having the facility to navigate to the Previous and Next Record also going to first and the last record.
    like we are using when we navigate from this forum
    FIRST PREVIOUS 1 2 3 4 5 6 7 8 9 10 NEXT LAST
    secondly if their is a possiblity their should be a search page to to specific page like this
    Go To this Page (Textfield)
    third thing when i am on first record the it shouldnt show PREVIOUS button and when it is in the last it should not show NEXT.
    this thing should be done by Using JSP , Servelets and Beans...
    and PLEASE DONT SAY THAT IT HAS ALREADY BEEN ASK IF SO TELL ME THE LINK BECAUSE I CANT FIND ANYWHERE IN THE FORUM SO PLEASE TRY TO PROVIDE THE SOURCODE OR ATLEAST A REFERENCE FOR IT.

    for your task there is nice keyword in MySQL:
    LIMIT [offset,] rows
    maybe MSSQL has something similar...
    though i haven't seen such a keyword in oracle nor postgre... nor mssql (but i haven't looked for it from there...)
    one way would be to skip first X results in resultset... in PyML i have used method .skip(count) for skiping count rows, but i'm not sure that in java there is equivalent for that, so you might have to just call ResultSet.next() for count times, and then ten more times to get desired data for your page.

  • Displaying results from a database query using servlets

    I have this HTML form where users can search a MS Access database by entering a combination of EmployeeID, First name or last name. This form invokes a Java Servlet which searches the database and displays the results as an HTML page. I am giving the user the choice of displaying 3, 5 or 10 results per page. I want to know how to do that using servlets. If a particular search results in 20 results, the results should be displayed in sets of 3, 5 or 10 depending on the user's choice. If the user makes a choice of 5 results per page then 4 pages should be displayed with a "next" and "previous" button on each page. I want to know how this can be done.

    Arun,
    I'm not sure how to do this using JSP as I have not worked on JSP.
    But I can give you a hint on how to do this within normal java class as I've used this in my current project.
    In your core class/bean that generates the entire resultset, you need to run a loop that will scan through the desired number of records in the resultset.
    To do this, you have to have skip and max parameter in your URL.
    Somthing like http://server.com/myservlet?skip=0&max=10 to display first 10 records, http://server.com/myservlet?skip=10&max=10 to display next 10 records. The <next>parameter would be fed in by the user by a simple form in your web-page. If you need to hold this <max-num-of-recs-per-page> param, you can store it in a cookie (since this is nothing crucial piece of info, don't need to use session obj etc...cookie will do) and get the value each time you display the resultset.
    So, essentially, suppose you are at the first page and you wish to show 10 recs at a time. The link for "Next" button would be http://server.com/myservlet?skip=10&max=10
    when at the second page, you'll have
    "priv" button as http://server.com/myservlet?skip=0&max=10 and
    "next" button as http://server.com/myservlet?skip=20&max=10 and so on...
    hope this makes sense..
    Shantanu

  • Problem displaying results from a SQL database

    Hey everyone,
    So I am basically fairly new to coding, i am doing a tutorial i found on the web and trying to implement into my own. I have gotten so far in it and now have struck a problem, when i search for a item in a database it wont find it and a previous problem i had was that it was displayin all the records instead of the searched records. Anyway here is my code and i would greatly appreciate any help as i am stuck on it for weeks now trying to change is around and its really disheartening. P.S. The link to the tutorial if its any help is:http://www.sebastiansulinski.co.uk/web_design_tutorials/tutorial/9/link_exchange_system_wi th_dreamweaver_cs3
    Thanks
    Frank
    <?php require_once('../Connections/cbdb.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_rsStock = 20;
    $pageNum_rsStock = 0;
    if (isset($_GET['pageNum_rsStock'])) {
      $pageNum_rsStock = $_GET['pageNum_rsStock'];
    $startRow_rsStock = $pageNum_rsStock * $maxRows_rsStock;
    mysql_select_db($database_cbdb, $cbdb);
    // Search engine functionality
    if ($_GET['make'] || $_GET['model']) {
    $key = $_GET['make'];
    $categ = $_GET['model'];
    $query_rsStock = "SELECT * FROM stock WHERE stock.model LIKE '%$make%' AND stock.model LIKE '%$model%' ORDER BY stock.date DESC";
    } else {
    $query_rsStock = "SELECT * FROM stock ORDER BY date DESC";
    $query_limit_rsStock = sprintf("%s LIMIT %d, %d", $query_rsStock, $startRow_rsStock, $maxRows_rsStock);
    $rsStock = mysql_query($query_limit_rsStock, $cbdb) or die(mysql_error());
    $row_rsStock = mysql_fetch_assoc($rsStock);
    if (isset($_GET['totalRows_rsStock'])) {
      $totalRows_rsStock = $_GET['totalRows_rsStock'];
    } else {
      $all_rsStock = mysql_query($query_rsStock);
      $totalRows_rsStock = mysql_num_rows($all_rsStock);
    $totalPages_rsStock = ceil($totalRows_rsStock/$maxRows_rsStock)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/admin.dwt.php" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <!-- InstanceEndEditable -->
    <link href="../style/admin_style.css" rel="stylesheet" type="text/css" media="screen" />
    <!-- InstanceBeginEditable name="head" --><title>Stock List</title>
    <script type="text/javascript">
    function tmt_confirm(msg){
    document.MM_returnValue=(confirm(unescape(msg)));
    </script>
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div id="wrapper">
    <div id="header"><p>Admin</p></div>
    <div id="navigation">
    <ul id="mainav">
    <li><a href="stock_list.php">List of stock</a></li>
    <li><a href="stock_add.php">Add new stock</a></li>
    <li><a href="make_add.php">Makes</a></li>
    <li><a href="logout.php">Logout</a></li>
    <li id="front"><a href="C:\xampp\htdocs\CarBreakers" target="_blank">front</a></li>
    </ul>
    </div>
    <div id="container"><!-- InstanceBeginEditable name="Content" -->
      <p id="ptitle">Stock</p>
      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get" id="forminsert">
      <table border="0" cellspacing="0" cellpadding="0" id="tblinsert">
      <caption>
        Search for Stock
      </caption>
      <tr>
        <th><label for="keyword">Make:</label></th>
        <td><input type="text" name="make" id="make" /></td>
        <th><label for="model">Model:</label></th>
        <td><input type="text" name="model" id="model" /></td>
        <td><input type="submit" id="button" value="Submit" /></td>
      </tr>
    </table>
      </form>
      <?php if ($totalRows_rsStock > 0) { // Show if recordset not empty ?>
          <?php if ($totalRows_rsStock == 0) { // Show if recordset empty ?>
      <p>Sorry, there are no records matching your searching criteria.</p>
      <?php } // Show if recordset empty ?>
    <table border="0" cellpadding="0" cellspacing="0" id="tblrepeat">
        <tr>
          <th width="63" scope="col">Make</th>
          <th width="67" scope="col">Model</th>
          <th width="59" scope="col">Year</th>
          <th width="79" scope="col">Engine cc</th>
          <th width="56" scope="col">Fuel</th>
          <th width="59" scope="col">Doors</th>
          <th width="56" scope="col">Body</th>
          <th width="104" scope="col">Arrival Date</th>
          <th width="51" scope="col">Edit</th>
          <th width="83" scope="col">Remove</th>
        </tr>
        <?php do { ?>
          <tr>
            <td><?php echo $row_rsStock['make']; ?></td>
            <td><?php echo $row_rsStock['model']; ?></td>
            <td><?php echo $row_rsStock['year']; ?></td>
            <td><?php echo $row_rsStock['cc']; ?></td>
            <td><?php echo $row_rsStock['fuel']; ?></td>
            <td><?php echo $row_rsStock['doors']; ?></td>
            <td><?php echo $row_rsStock['body']; ?></td>
            <td><?php echo $row_rsStock['date']; ?></td>
            <td><a href="stock_edit.php?id=<?php echo $row_rsStock['stockId']; ?>">Edit</a></td>
            <td><a href="stock_remove.php?id=<?php echo $row_rsStock['stockId']; ?>" onclick="tmt_confirm('Are%20you%20sure%20you%20want%20to%20perform%20this%20action?');ret urn document.MM_returnValue">Remove</a></td>
          </tr>
          <?php } while ($row_rsStock = mysql_fetch_assoc($rsStock)); ?>
    </table>
      <?php } // Show if recordset not empty ?>
    <!-- InstanceEndEditable --></div>
    <div id="footer"><p>© <a href="http://www.blablabla.com/" title="Web Designer" target="_blank">Web Design</a></p></div>
    </div>
    </body>
    <!-- InstanceEnd --></html>
    <?php
    mysql_free_result($rsStock);
    ?>

    In your code, you have this -
    // Search engine functionality
    if ($_GET['make'] || $_GET['model']) {
    $key = $_GET['make'];
    $categ = $_GET['model'];
    $query_rsStock = "SELECT * FROM stock WHERE stock.model LIKE '%$make%' AND stock.model LIKE '%$model%' ORDER BY stock.date DESC";
    } else {
    $query_rsStock = "SELECT * FROM stock ORDER BY date DESC";
    The "else" part of the "if" block is what is selecting ALL the records -
    $query_rsStock = "SELECT * FROM stock ORDER BY date DESC";
    This means that the "if" part of the "if" block is always failing.  When does it fail?  Whenever you have not passed a URL variable for either "make" or "model".  Are you sure you are correctly passing that variable?

  • All Records are not getting displayed in adobe form from table

    Hi All,
    I Want to display records from table  to Adobe Form Table .
    But While Displaying only some of the records are getting displayed How can i display all the records in next pages of adobe form.
    Its Urgent PLZ Reploy soon.
    Thanks & Regards
       Kiran

    dear friend,
    please check the adobe format, must be match to
    the data base format.
    pls go to the setting and adjust the data base table.
    if nothing is going click the radio button
    html format.
    that will work.
    rewards are expecting.
    vivek

Maybe you are looking for

  • LG G2 When I select share while in the gallery, facebook doesn't come up as an option.  Is there something I need to set up differently?

    LG G2 When I select share while in the gallery, facebook doesn't come up as an option.  Is there something I need to set up differently?

  • 64 bit software on x86 hardware

    I have a Windows XP machine that is 32 bit (x86) hardware.  The machine was sent to a company that was supposed to upgrade to Windows 7.  This is an x86 system. The company upgraded using Windows 7 64-bit software.  The system now seems to have some

  • Battery will not charge on my Mac Book Pro.

    I recently (as in, a few months ago) replaced the battery on my Mac Book Pro, because I had overcharged my previous one into oblivion. Since I replaced the battery, however, the computer has been working fine - until today, anyways. The computer will

  • Unknown menu bar item

    Does anybody recognize this menu bar item? It shows up in 2 places every now and then, usually faintly towards the middle, and darker towards the right of the menu bar, and neithjer of them responds to any clicks (right, left, option, command or comb

  • Different operating systems confusing router

    Hardwired computer hooked to WRT54G V8  with Windows XP works fine. Add Acer laptop either hardwired or wireless with Vista basic and it will not stay connected to internet or not connect at all. If XP computer unplugged from router, Acer will work p