Search Results

Search found 34207 results on 1369 pages for 'query output'.

Page 100/1369 | < Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >

  • Get list of named queries in NHibernate

    - by Dan
    I have a dozen or so named queries in my NHibernate project and I want to execute them against a test database in unit tests to make sure the syntax still matches the changing domain/database model. Currently I have a unit test for each named query where I get and execute the query, for example: IQuery query = session.GetNamedQuery("GetPersonSummaries"); var personSummaryArray = query.List(); Assert.That(personSummaryArray, Is.Not.Null); This works fine, but I would like to have one unit test that loops thru all of the named queries and executes them. Is there a way to discover all of the available named queries? Thanks Dan

    Read the article

  • Amazon Web Services Free Trial: query about get and put requests

    - by abel
    Amazon recently introduced a free tier for its cloud offering. I signed up for AWS and while signing up for the free tier of S3, i found this As part of AWS Free Usage Tier, you can get started with Amazon S3 for free. Upon sign-up, new AWS customers receive 5 GB of Amazon S3 storage, 20,000 Get Requests, 2,000 Put Requests, 15GB of bandwidth in and 15GB of bandwidth out each month for one year. source:aws.amazon.com , emphasis mine. 20,000 GET requests & 2000 puts mean , 20,000 page views(max) and 2000 file uploads per month. Isn't that lower than what App Engine offers 43,200,000 requests per day.Am I missing some thing, please help.

    Read the article

  • LOAD DATA INFILE with variables

    - by Hasitha
    I was tring to use the LOAD DATA INFILE as a sotred procedure but it seems it cannot be done. Then i tried the usual way of embedding the code to the application itself like so, conn = new MySqlConnection(connStr); conn.Open(); MySqlCommand cmd = new MySqlCommand(); cmd = conn.CreateCommand(); string tableName = getTableName(serverName); string query = "LOAD DATA INFILE '" + fileName + "'INTO TABLE "+ tableName +" FIELDS TERMINATED BY '"+colSep+"' ENCLOSED BY '"+colEncap+"' ESCAPED BY '"+colEncap+"'LINES TERMINATED BY '"+colNewLine+"' ("+colUpFormat+");"; cmd.CommandText = query; cmd.ExecuteNonQuery(); conn.Close(); The generated query that gets saved in the string variable query is, LOAD DATA INFILE 'data_file.csv'INTO TABLE tbl_shadowserver_bot_geo FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '"'LINES TERMINATED BY '\n' (timestamp,ip,port,asn,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,url,agent,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy,@dummy); But now when i run the program it gives an error saying, MySQLException(0x80004005) Parameter @dummy must be defined first. I dont know how to get around this, but when i use the same query on mysql itself directly it works fine. PLEASE help me..thank you very much :)

    Read the article

  • Dynamic filter expressions in an OpenAccess LINQ query

    We had some support questions recently where our customers had the need to combine multiple smaller predicate expressions with either an OR or an AND  logical operators (these will be the || and && operators if you are using C#). And because the code from the answer that we sent to these customers is very interesting, and can easily be refactorred into something reusable, we decided to write this blog post. The key thing that one must know is that if you want your predicate to be translated by OpenAccess ORM to SQL and executed on the server you must have a LINQ Expression that is not compiled. So, let’s say that you have these smaller predicate expressions: Expression<Func<Customer, bool>> filter1 = c => c.City.StartsWith("S");Expression<Func<Customer, bool>> filter2 = c => c.City.StartsWith("M");Expression<Func<Customer, bool>> filter3 = c => c.ContactTitle == "Owner"; And ...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Unwanted Shell expansion when assigning the output of a shell command to a variable

    - by Rob Goodwin
    I am exporting a portion of a local prototypte svn repository to import into a different repo. We have a number of svn properties set throughout the repo so I figured I would write a script to list the file elements and their corresponding properties. How hard can that be right. So I write started writing a bash script that would assign the output of the svn proplist -v to a variable so I could check if the specified file had any properties. #!/bin/bash svn proplist -v $1 o=$(svn proplist -v "$1") echo $o now this works fine and echos the output of the svn proplist command. But if the proplist command returns something like svn:ignore : * build it performs a shell expansion on the * and inserts the entire directory listing prior to the build property value. So if the directory had a.txt, b.txt and build files/dirs in it, the output would look like. svn:ignore a.txt b.txt build I figure I need to somehow escape the output or something to keep the expansion from happening, but have yet to find something that works. There are other ways to do this, but I hate when I cannot figure something out. and I have to admin, I think this one beat me ( well given the time I can spend on it )

    Read the article

  • Funky Behavior NoTracking Query Entities

    I’ve been using a lot of NoTracking queries to grab lists of data that I don’t need change tracked. It enhances performance and cuts down on resources. There are some nuances about these entities, however. One of the interesting behaviors of EF4’s Lazy Loading is that even if you have entities that you have queried with NoTracking on, they will still lazy load related entities. Unless you’ve read this somewhere (it’s on the ADO.NET team’s blog post which introduces...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • OData Query Option top Forces Data To Be Sorted By Primary Key

    This post show a simple WCF Data Service (Formerly known as ADO.NET Data Services) project that retrieves data using the Reflection Provider for accessing data. It goes on to show that using $top... This site is a resource for asp.net web programming. It has examples by Peter Kellner of techniques for high performance programming...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Cross platform development query

    - by Ian
    I'm a Microsoft developer mainly, but there are a couple of small-ish projects I'd like to fiddle with which would benefit from being cross platform. The platforms I want to target are: Windows, Linux, Mac, Android and preferably iPhone, web (running in a browser). I need 3D (Around the level of support seen in something like Minecraft (I'm not writing Minecraft)), some networking. I'm pretty certain Java would work on all except iPhone. Looking at the "related questions" above it's offered up QT (no browser or phone afaik) and also HTML/CSS/Javascript (3D? package for desktop?) The other alternative is to have seperate versions for seperate platforms, developed with some common code where possible. That option isn't something I know anything about. Does anyone have experience of this sort of conundrum? I figured here was better than SO, because I imagine there are compromises which extend beyond technical choice. Finally, this is not a commercial operation, so some of the very expensive cross platform tools are out of the question unless they offer some sort of community edition. Thanks for your time.

    Read the article

  • Using The Data Mining Query Task in SSIS

    SQL Server Integration Services (SSIS) is a Business Intelligence tool which can be used by database developers or administrators to perform Extract, Transform & Load (ETL) operations. In my previous article Using Analysis Services Processing Task & Analysis Services ... [Read Full Article]

    Read the article

  • JPA native query join returns object but dereference throws class cast exception

    - by masato-san
    I'm using JPQL Native query to join table and query result is stored in List<Object[]>. public String getJoinJpqlNativeQuery() { String final SQL_JOIN = "SELECT v1.bitbit, v1.numnum, v1.someTime, t1.username, t1.anotherNum FROM MasatosanTest t1 JOIN MasatoView v1 ON v1.username = t1.username;" System.out.println("get join jpql native query is being called ============================"); EntityManager em = null; List<Object[]> out = null; try { em = EmProvider.getDefaultManager(); Query query = em.createNativeQuery(SQL_JOIN); out = query.getResultList(); System.out.println("return object ==========>" + out); System.out.println(out.get(0)); String one = out.get(0).toString(); //LINE 77 where ClassCastException System.out.println(one); } catch(Exception e) { } finally { if(em != null) { em.close; } } } The problem is System.out.println("return object ==========>" + out); outputs: return object ==========> [[true, 0, 2010-12-21 15:32:53.0, masatosan, 0.020], [false, 0, 2010-12-21 15:32:53.0, koga, 0.213]] System.out.println(out.get(0)) outputs: [true, 0, 2010-12-21 15:32:53.0, masatosan, 0.020] So I assumed that I can assign return value of out.get(0) which should be String: String one = out.get(0).toString(); But I get weird ClassCastException. java.lang.ClassCastException: java.util.Vector cannot be cast to [Ljava.lang.Object; at local.test.jaxrs.MasatosanTestResource.getJoinJpqlNativeQuery (MasatosanTestResource.java:77) So what's really going on? Even Object[] foo = out.get(0); would throw an ClassCastException :(

    Read the article

  • MySQL table data transformation -- how can I dis-aggreate MySQL time data?

    - by lighthouse65
    We are coding for a MySQL data warehousing application that stores descriptive data (User ID, Work ID, Machine ID, Start and End Time columns in the first table below) associated with time and production quantity data (Output and Time columns in the first table below) upon which aggregate (SUM, COUNT, AVG) functions are applied. We now wish to dis-aggregate time data for another type of analysis. Our current data table design: +---------+---------+------------+---------------------+---------------------+--------+------+ | User ID | Work ID | Machine ID | Event Start Time | Event End Time | Output | Time | +---------+---------+------------+---------------------+---------------------+--------+------+ | 080025 | ABC123 | M01 | 2008-01-24 16:19:15 | 2008-01-24 16:34:45 | 2120 | 930 | +---------+---------+------------+---------------------+---------------------+--------+------+ Reprocessing dis-aggregation that we would like to do would be to transform table content based on a granularity of minutes, rather than the current production event ("Event Start Time" and "Event End Time") granularity. The resulting reprocessing of existing table rows would look like: +---------+---------+------------+---------------------+--------+ | User ID | Work ID | Machine ID | Production Minute | Output | +---------+---------+------------+---------------------+--------+ | 080025 | ABC123 | M01 | 2010-01-24 16:19 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:20 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:21 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:22 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:23 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:24 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:25 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:26 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:27 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:28 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:29 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:30 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:31 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:22 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:33 | 133 | | 080025 | ABC123 | M01 | 2010-01-24 16:34 | 133 | +---------+---------+------------+---------------------+--------+ So the reprocessing would take an existing row of data created at the granularity of production event and modify the granularity to minutes, eliminating redundant (Event End Time, Time) columns while doing so. It assumes a constant rate of production and divides output by the difference in minutes plus one to populate the new table's Output column. I know this can be done in code...but can it be done entirely in a MySQL insert statement (or otherwise entirely in MySQL)? I am thinking of a INSERT ... INTO construction but keep getting stuck. An additional complexity is that there are hundreds of machines to include in the operation so there will be multiple rows (one for each machine) for each minute of the day. Any ideas would be much appreciated. Thanks.

    Read the article

  • Database EAV model, record listing as per search

    - by Shyam Sunder Verma
    I am building a dynamic application. I have three tables : ( EAV model style) 1: Items ( ItemId, ItemName) 2: Fields (FieldId, FieldName) 3: Field Values ( ItemID, FieldId, Value) Can you tell me how to write SINGLE query to get starting 20 records from ALL items where FieldId=4 is equal to TRUE. Expected Result : Columns = ItemID | Name | Field1 | Field2 | Field3 Each Row= ItemId | ItemName| Value1 | Value2 | Value3 Important concerns : 1: Number of fields per item are not known 2: I need one to write ONE query. 3: Query will be running on 100K records, so performance is concern. 4: I am using MySQL 5.0, so need solution for MYSQL Should I denormalize the tables if above query is not possible at all ? Any advice ?

    Read the article

  • Foreign/accented characters in sql query

    - by FromCanada
    I'm using Java and Spring's JdbcTemplate class to build an SQL query in Java that queries a Postgres database. However, I'm having trouble executing queries that contain foreign/accented characters. For example the (trimmed) code: JdbcTemplate select = new JdbcTemplate( postgresDatabase ); String query = "SELECT id FROM province WHERE name = 'Ontario';"; Integer id = select.queryForObject( query, Integer.class ); will retrieve the province id, but if instead I did name = 'Québec' then the query fails to return any results (this value is in the database so the problem isn't that it's missing). I believe the source of the problem is that the database I am required to use has the default client encoding set to SQL_ASCII, which according to this prevents automatic character set conversions. (The Java environments encoding is set to 'UTF-8' while I'm told the database uses 'LATIN1' / 'ISO-8859-1') I was able to manually indicate the encoding when the resultSets contained values with foreign characters as a solution to a previous problem with a similar nature. Ex: String provinceName = new String ( resultSet.getBytes( "name" ), "ISO-8859-1" ); But now that the foreign characters are part of the query itself this approach hasn't been successful. (I suppose since the query has to be saved in a String before being executed anyway, breaking it down into bytes and then changing the encoding only muddles the characters further.) Is there a way around this without having to change the properties of the database or reconstruct it? PostScript: I found this function on StackOverflow when making up a title, it didn't seem to work (I might not have used it correctly, but even if it did work it doesn't seem like it could be the best solution.):

    Read the article

  • Force 'Replace Into' to use a certain index

    - by Bobby
    I have a MySQL (5.0) table with 3 rows which are considered a combined Unique Index: CREATE TABLE `test`.`table_a` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `field1` varchar(5) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `field2` varchar(5) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `field3` varchar(5) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', PRIMARY KEY (`Id`), INDEX `IdxUnqiue` (`field1`(5),`field2`(5),`field3`(5)) ) ENGINE=MyISAM; This table should be filled with a REPLACE INTO query: REPLACE INTO table_a ( Field1, Field2, Field3 ) VALUES ( "Test1", "Test2", "Test3" ) The behavior I'd like to see is that this query always overrides the previous inserted row, because IdxUnique is...ahm, triggered. But unfortunately, there's still the primary index which seems to kick in and always inserts a new row. What I get: Query was executed 3 times: +---Id---+---Field1---+---Field2---+---Field3---+ | 1 | Test1 | Test2 | Test2 | | 2 | Test1 | Test2 | Test2 | | 3 | Test1 | Test2 | Test2 | +--------+------------+------------+------------+ What I want: Query was executed 3 times: +---Id---+---Field1---+---Field2---+---Field3---+ | 3 | Test1 | Test2 | Test2 | +--------+------------+------------+------------+ So, can I tell REPLACE INTO to use just a certain Index or to consider one 'more inportant' then another?

    Read the article

  • Oracle: show parameters on error

    - by llappall
    When Oracle logs a parameterized SQL query failing, it shows "?" in place of the parameters, i.e. the query before replacing parameters. For example, "SELECT * FROM table where col like '?'" SQL state [99999]; error code [29902]; ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: Oracle Text error: DRG-50901: text query parser syntax error on line 1, column 48 Is there a way to change logging so it shows the parameter values? The information above is absolutely useless unless I can see what the actual parsing problem was. In general, is there a way to set logs in Oracle to show parameters in parameterized query errors?

    Read the article

  • mySQL Left Join on multiple tables

    - by Jarrod
    Hi I'm really struggling with this query. I have 4 tables (http://oberto.co.nz/db-sql.png): Invoice_Payement, Invoice, Client and Calendar. I'm trying to create a report by summing up the 'paid_amount' col, in Invoice_Payment, by month/year. The query needs to include all months, even those with no data There query needs the condition (Invoice table): registered_id = [id] I have tried with the below query, which works, but falls short when 'paid_date' does not have any records for a month. The outcome is that month does not show in the results I added a Calendar table to resolved this but not sure how to left join to it. SELECT MONTHNAME(Invoice_Payments.date_paid) as month, SUM(Invoice_Payments.paid_amount) AS total FROM Invoice, Client, Invoice_Payments WHERE Client.registered_id = 1 AND Client.id = Invoice.client_id And Invoice.id = Invoice_Payments.invoice_id AND date_paid IS NOT NULL GROUP BY YEAR(Invoice_Payments.date_paid), MONTH(Invoice_Payments.date_paid) Please see the above link for a basic ERD diagram of my scenario. Thanks for reading. I've posted this Q before but I think I worded it badly.

    Read the article

  • Need some help with a MySQL subquery count

    - by Ferdy
    I'm running into my own limits of MySQL query skills, so I hope some SQL guru can help out on this one. The situation is as follow: I have images that can be tagged. As you might expect this is stored in three tables: Image Tag Tag_map (maps images to tags) I have a SQL query that calculates the related tags based on a tag id. The query basically checks what other tags were used for images for images using that tag. Example: Image1 tagged as "Bear" Image2 tagged as "Bear" and "Canada" If I throw "Bear" (or its tag id) at the query, it will return "Canada". This works fine. Here's the query: SELECT tag.name, tag.id, COUNT(tag_map.id) as cnt FROM tag_map,tag WHERE tag_map.tag_id = tag.id AND tag.id != '185' AND tag_map.image_id IN (SELECT tag_map.image_id FROM tag_map INNER JOIN tag ON tag_map.tag_id = tag.id WHERE tag.id = '185') GROUP BY tag_map.id LIMIT 0,100 The part I'm stuck with is the count. For each related tag returned, I want to know how many images are in that tag. Currently it always returns 1, even if there are for example 3. I've tried counting different columns all resulting in the same output, so I guess there is a flaw in my thinking.

    Read the article

  • Undocumented Query Plans: The ANY Aggregate

    - by Paul White
    As usual, here’s a sample table: With some sample data: And an index that will be useful shortly: There’s a complete script to create the table and add the data at the end of this post.  There’s nothing special about the table or the data (except that I wanted to have some fun with values and data types). The Task We are asked to return distinct values of col1 and col2 , together with any one value from the thing column (it doesn’t matter which) per group.  One possible result set is shown...(read more)

    Read the article

  • Odd 'UNION' behavior in an Oracle SQL query

    - by RenderIn
    Here's my query: SELECT my_view.* FROM my_view WHERE my_view.trial in (select 2 as trial_id from dual union select 3 from dual union select 4 from dual) and my_view.location like ('123-%') When I execute this query it returns results which do not conform to the my_view.location like ('123-%') condition. It's as if that condition is being ignored completely. I can even change it to my_view.location IS NULL and it returns the same results, despite that field being not-nullable. I know this query seems ridiculous with the selects from dual, but I've structured it this way to replicate a problem I have when I use a 'WITH' clause (the results of that query are where the selects from dual inline view are). I can modify the query like so and it returns the expected results: SELECT my_view.* FROM my_view WHERE my_view.trial in (2, 3, 4) and my_view.location like ('123-%') Unfortunately I do not know the trial values up front (they are queried for in a 'WITH' clause) so I cannot structure my query this way. What am I doing wrong? I will say that the my_view view is composed of 3 other views whose results are UNION ALL and each of which retrieve some data over a DB Link. Not that I believe that should matter, but in case it does.

    Read the article

  • The query parameter '$format' begins with a system-reserved '$' character but is not recognized

    Tuesday morning I was ranting on Twitter , well really whining, about how WCF Data Services does not support JSON format out of the box. Fortunately I was shown the answer in replies to my rant. So I want to share this with you. First, I made the mistake...(read more)...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • The query parameter '$format' begins with a system-reserved '$' character but is not recognized

    Tuesday morning I was ranting on Twitter , well really whining, about how WCF Data Services does not support JSON format out of the box. Fortunately I was shown the answer in replies to my rant. So I want to share this with you. First, I made the mistake...(read more)...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • KDE: How can I select audio output device for mplayer?

    - by grimripper
    I recently installed Kubuntu 13.10 64-bit, and I'm having a problem with selecting audio output device. In Phonon, when I select audio device preference order and press Apply, Amarok and Dragon will immediately switch to the preferred device. VLC and SMplayer are not affected. VLC has its own setting for selecting the output device, but SMplayer remains a problem. It always plays audio on internal audio, and I can't change output to HDMI. How can I select HDMI for SMplayer's audio output device? I don't know if it matters, but when I select HDMI audio in Phonon and click Test, the test sound plays on the internal audio output as well. In the hardware settings tab, the front left and front right test buttons play audio on HDMI. Also, volume up/down buttons affect HDMI volume when SMplayer is focused. This would make sense if I could get SMplayer to play audio over HDMI, but it would be better if the volume keys affected SMplayer's own volume, or the "mplayer2: audio stream" which appears in volume control while mplayer is playing. EDIT: I've recompiled mplayer with alsa support, and can now select the audio output device from SMplayer's settings. Didn't affect the issue with Phonon of course, but it's a suitable workaround.

    Read the article

  • MySql: Query multiple identical dynamic tables.

    - by JYelton
    I have a database with 500+ tables, each with identical structure, that contain historical data from sensors. I am trying to come up with a query that will locate, for example, all instances where sensor n exceeds x. The problem is that the tables are dynamic, the query must be able to dynamically obtain the list of tables. I can query information_schema.tables to get a list of the tables, like so: SELECT table_name FROM information_schema.tables WHERE table_schema = 'database_name'; I can use this to create a loop in the program and then query the database repeatedly, however it seems like there should be a way to have MySql do the multiple table search. I have not been able to make a stored procedure that works, but the examples I can find are generally for searching for a string in any column. I want to specifically find data in a specific column that exists in all tables. I admit I do not understand how to properly use stored procedures nor if they are the appropriate solution to this problem. An example query inside the loop would be: SELECT device_name, sensor_value FROM device_table WHERE sensor_value > 10; Trying the following does not work: SELECT device_name, sensor_value FROM ( SELECT table_name FROM information_schema.tables WHERE table_schema = 'database_name' ) WHERE sensor_value > 10; It results in an error: "Every derived table must have its own alias." The goal is to have a list of all devices that have had a given sensor value occur anywhere in their log (table). Ultimately, should I just loop in my program once I've obtained a list of tables, or is there a query structure that would be more efficient?

    Read the article

  • Create a nested list

    - by sico87
    How would I create a nested list, I currently have this public function getNav($cat,$subcat){ //gets all sub categories for a specific category if(!$this->checkValue($cat)) return false; //checks data $query = false; if($cat=='NULL'){ $sql = "SELECT itemID, title, parent, url, description, image FROM p_cat WHERE deleted = 0 AND parent is NULL ORDER BY position;"; $query = $this->db->query($sql) or die($this->db->error); }else{ //die($cat); $sql = "SET @parent = (SELECT c.itemID FROM p_cat c WHERE url = '".$this->sql($cat)."' AND deleted = 0); SELECT c1.itemID, c1.title, c1.parent, c1.url, c1.description, c1.image, (SELECT c2.url FROM p_cat c2 WHERE c2.itemID = c1.parent LIMIT 1) as parentUrl FROM p_cat c1 WHERE c1.deleted = 0 AND c1.parent = @parent ORDER BY c1.position;"; $query = $this->db->multi_query($sql) or die($this->db->error); $this->db->store_result(); $this->db->next_result(); $query = $this->db->store_result(); } return $query; } public function getNav($cat=false, $subcat=false){ //gets a list of all categories form this level, if $cat is false it returns top level nav if($cat==false || strtolower($cat)=='all-products') $cat='NULL'; $ds = $this->data->getNav($cat, $subcat); $nav = $ds ? $ds : false; $html = ''; //create html if($nav){ $html = '<ul>'; //var_dump($nav->fetch_assoc()); while($row = $nav->fetch_assoc()){ $url = isset($row['parentUrl']) ? $row['parentUrl'].'/'.$row['url'] : $row['url']; $current = $subcat==$row['url'] ? ' class="current"' : ''; $html .= '<li'.$current.'><a href="/'.$url.'/">'.$row['title'].'</a></li>'; } $html .='</ul>'; } return $html; } The sql returns parents and children, for each parent I need the child to nest in a list.

    Read the article

< Previous Page | 96 97 98 99 100 101 102 103 104 105 106 107  | Next Page >