I like the way the query() method returns an array of resources, which can be saved to the server again. I am trying to use Angular against the Drupal RestWS module, which returns an object with several "meta" properties and a property called list where the actual data are stored. Is there please a way of telling the resource to take th...

So i have a php script that i run directly from the browser and i get 2 errors: Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in... Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in... In this script i make a query to select all blogs from my blog table: $result = $this...

I try the following query, and which produces an array, $user = Yii::app()->reg->createCommand() ->select('studentID') ->from('Students') ->queryAll(); But, when i try to get the value of the query in CGridview, Im getting the error, Property "CDbCommand.0" is not defined. here is the code for gridview, $this->widget('zii.widgets.grid.CGr...

I have an array of data that generates unique data on the fly in a manor of speaking. It's actually an array with 5 hashes. What I want to do is a basic select query with a where clause that checks each via OR basically a one line query rather than a query for each array item. I'm attempting to ensure that no one hash that enters the db i...

I've set up a local environment, where I load data from a json file: var Players = $resource('data/players.json'); var players = Players.query(function(){}); And it works great. Now I want to access a couchdb one a different domain (http://playball.iriscouch.com/players), and based one the google buzz example I've tried the following, b...

I have the result of a certain query which I have to display in a List control in my webpage. Query 1 result: 4 items in descending order Query 2 result: Top 1 result Actually, I have to display the first result from the first query, first result from the second query and then the remaining three from the first query results. Initially, I...

I am programming for iOS, and using ARC. I am trying to use a c-array as property, but it reports error. @property (strong, nonatomic)NSString *mappingTable[70][254]; The error is "Property cannot have array or function type NSString *[70][254]" . How can I solve this problem? How can I declare c-array as property? Note: This is a two dim...

I need to populate a single-dimension array with a result set from a select query. I have created the array type using: create or replace type UR.array_traveler_id as BIGINT array[]; and in the stored proc I am using the following SELECT INTO query: SELECT TRAVELER_ID bulk collect INTO arraylist FROM UR.APPLIEDPROFILE where TRAVELERPROFIL...

I'm printing out a table with 27 cols from a database, so its obvious that it'll be aesthetically displeasing if 27 cols were visible on my screen. so this is one of the conditions i've been using to see if a particular col is empty, if it is empty then the table header will not be printed and if that isnt printed another if isset conditi...

I am trying to speed up my iOS App by using Grand Central Dispatch's dispatch_apply method for parallel execution of multiple independent tasks. However, these tasks share a readonly resource (a large uint8_t array), which is accessed via a readonly, nonatomic object property. Since it is a readonly resource, no synchronized access is nec...

I have a counterpart, which has an address, which MIGHT have a country assigned. How do I handle this: InvoiceAddress invoiceAddres = null; Country InvoiceAddressCountry = null; Counterpart counterpart = null; CounterpartTabDTO result = null; // projections for DTO-mapping var projections = new[] { Projections.Property(() => counterp...

I'm trying to update a value of a column using the codeigniter query function like this: $this->db->query("UPDATE table SET val = val + 1 WHERE name = 'xxxxx'); Is there any way to get the result of this update in the same query function? I have to do a select query in order to do it and it's dangerous because of the amount of users this...

i have two query $q1 and $q2. from the query1 i get multiple records and each record having id and i want use this id for second query in where condition. i am doing this in controller. i have tried following code. In the foreach i am trying to store id and pass to $q2 where condition. //Query 1 $q1 = $this->db->select(array( 'spf.id as...

I am using Xpath in PHP - I know that my query will return either 0 or 1 results. If 1 result is returned I do not want it as an array - which is what is returned right now. I simply want the value without having to access the [0] element of the result and cast to a string. Is this possible?...

I'm working in my project an having a difficulties generating query result $query = $this->db->query("YOUR QUERY"); foreach ($query->result_array() as $row) echo $row['title']; echo $row['name']; echo $row['body']; i wonder if i could do like this $query = $this-> query("YOUR QUERY"); foreach ($query->result_array() as $row...

I have searched for a few hours already but have found nothing on the subject. I am developing a website that depends on a query to define the elements that must be loaded on the page. But to organize the data, I must repass the result of this query 4 times. At first try, I started using mysql_data_seek so I could repass the query, but I...

I want to pass a mySQL result from a function and print the data. How to do so ? <?php function showLatestItems() $result = $this->query("SELECT aid,name,description,img,amount,strtdate ,enddate FROM item WHERE enddate>now()"); return $result; /* while($row=mysql_fetch_array($result)) echo $row[0].' '.$row[3].' '.$row[...

I'm trying to understand array unrolling in Posh and the following puzzles me. In this example I return the array wrapped in another array (using a comma), which basically gives me the original array after the outer array gets unrolled on return. Why then do I get a correct result (just the array) when I indirectly wrap the result by usin...

I have the two queries below I'd like to combine into one and get a difference result. Query 1 SELECT SUM(col1 + col2) As total FROM tableA Query 2 SELECT SUM(total) FROM tableB WHERE color not like '%black' and model not like 'CF%' I'd like to combine these in a SELECT query and get the result: Query 1 - Query 2 = result. The tables both...

In my html (.ng-template) I have an array, on which a filter is applied. I want to apply a map function to the result of this filter function (It's too expensive to apply it to the whole array before applying the filter). The older versions of angularjs allowed me to do so by But with the new syntax (v 1.0.5) I am not able to do this. I...

I'm trying to display the results of my query in a neatly formatted table but I'm pretty new to php so I'm at a bit of a loss. Currently I have this: $dbconn = pg_connect("host=localhost port=5432 dbname=mary"); $result = pg_query($dbconn, $selectStmt); $resultArr = pg_fetch_all($result); print_r($resultArr); Assume $selectStmt = SELECT S...

I've discovered flot for jquery for drawing nice graphs. But I can't parse the data I want to represent from MYSQL. It's driving me crazy because I get this error: uncaught exception: Invalid dimensions for plot, width = 0, height = 0 Is there any way to put MYSQL data into flot apart from this?: php part: <?php include './includes/con...

Update: I've switched to CarrierWave (finally got it to work), so although I still appreciate answers to this question I won't be able to try if they actually work since I've completely removed DM-Paperclip from my code. Hi there, I'm developing a Sinatra-webapp using DataMapper and are now looking to add some upload-functionality with...

i am using join function in codeigniter and cant get it to work it only displays one table data but not the other am new to codeigniter cant figure this out pleas someone help me tnx in advance. view answerA;?> answerB;?> answerC;?> comment;?> name; ?> controller function getall(){ $this->load->model('result_model'); $data['query'...

Whats the wrong with this code. Getting this error Fatal error: Call to a member function result() on a non-object in /system/application/models/miscellaneous model.php on line function getSubCategories($categoryId){ $this->db->select("CATEGORY_ID,SUB _CATEGORY_URL AS CATEGORY_URL, CATEGORY_DESC,ACTIVE_STATUS,SORT_ORDER") ; $whereCo...

i am trying to convert the result of my query into a json format so i can grap it with jquery in another file. I dont get any errors but its not recognised as json. $patientquery = mysqli_query($connect, "SELECT * FROM login WHERE assignedTo='$logID'"); $numrows = mysqli_num_rows($patientquery); if($numrows > 0) while($rows = mysqli_f...

Im very new to IOS and PFQuery and I need your help please IM trying to store the array of objects obtained form PFQuery into a local NSArray, Im trying to do it inside if (!error) but it does not leave the block, once the block terminates so does the values for it on my array. //InstallersDirectory.m @interface InstallersDirectoryTVC (...

I need to pass special symbols through the URL for my MySQL query. For example, I need to have a URL that is something like: www.example.com/index.php?q=AND name LIKE '%hi%' When I tried it at first, I got a 406 error. I looked it up and apparently I have to use urlencode() and urldecode(). I put those in, and the 406 error went away, but...