What is the most complex expression you've seen/used ?
and what's the limit on the length of the expression that can be used ? I seem to recall something to that effect a while back but can't locate it now !!
I want to get file size I'm doing this:
my $filename=$query->param("upload_file");
my $filesize = (-s $filename);
print "Size: $filesize ";`
Yet it is not working. Note that I did not upload the file. I want to check its size before uploading it. So tolimit it to max of 1 MB.
I would like to know if anyone know something about the re-compression of a file multiple times, with gain and if there is a theoretical limitto the gain.
possible related to: How many times a file be compressed?
Hi,
I have this MySql select query witch seams to have a bug but I am quit "green" so I simple can not see, so maybe you could help?
Here is the query:
SELECT node_id
FROM rate
WHERE node_id='".$cat_node_id_string."'
LIMIT ".$node_count_star.",".$node_count_end."
ORDER BY SUM(amount)
GROUP BY node_id
Thanks for help in advance...
I'm using Doctrine 2 with my Zend Framework application and a typical query result could yield a million (or more) search results.
I want to use Zend_Paginator in line with this result set. However, I don't want to return all the results as an array and use the Array adapter as this would be inefficient, instead I would like to supply the paginator the total amount of rows then and array of results based on limit/offset amounts.
Is this doable using the Array adapter or would I need to create my own pagination adapter?
Soon I'll be launching my new site and i was planning on using gmail as the email server for things like registration and lost password.
I'll be using google apps (free version) so I can have [email protected].
Besides the 500/day limit are there any other potential problems with using gmail for this service?
Hi all!
I would like to know: when programming in C using a socket (AF_UNIX) is there any limit (in bytes) when sending or receiving to or from a socket?
Thank you!
—Albé
i'm having 2 tables: members and comments.
I select all members, and then join comments.
But in comments I'm selecting some SUM of points, and if user never commented, I can't get that user in listing?!
So how to select default value for SUM, or some other solution:
SELECT c.comment_id AS item_id, m.member_id AS member_id, m.avatar,
SUM(c.vote_value) AS vote_value, SUM(c.best) AS best,
SUM(c.vote_value) + SUM(c.najbolji)*10 AS total
FROM members m
LEFT JOIN comments c ON m.member_id = c.author_id
GROUP BY c.author_id
ORDER BY m.member_id DESC
LIMIT {$sql_start}, {$sql_pokazi}
Hello,
I have a list of urls for which I want to display first 200 or 250 characters. Can I do it using jquery or should I download them on the server side [using PHP] and store them in database?
I guess I will have to use fopen with limit of characters. **
I want to crawl a website and store the content on my computer for later analysis. However my OS file system has a limit on the number of sub directories, meaning storing the original folder structure is not going to work.
Suggestions?
Map the URL to some filename so can store flatly? Or just shove it in a database like sqlite to avoid file system limitations?
I have applied modalpopup.js to display error & restrict word limit counter to 300words for messages. Although it displays error message but user can still type words more than 300words in windows operating system. It works fine in fedora operating system.Can somebody help solve the issue.
I would like tolimit the accuracy of a call to GClientGeocoder.getLocations so that it only returns results with accuracy of say 0 to 3, that is from unknown to sub-region.
The idea is to find the rough area in which the user clicked.
mysql> EXPLAIN SELECT * FROM urls ORDER BY RAND() LIMIT 1;
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
| 1 | SIMPLE | urls | ALL | NULL | NULL | NULL | NULL | 62228 | Using temporary; Using filesort |
+----+-------------+-------+------+---------------+------+---------+------+-------+---------------------------------+
The above doesn't qualify as efficient,how should I do it properly?
Hello,
I have a xml file with 100 records, but I want it tolimit it to just 5 records
for ($i=0;$i<=5;$i++) {
foreach($xml-entry as $result){
if ($result->updated == $result->published) {
}
}
}
When I put in the above code, it display one record 5 times.
Thanks
Jean
I am binding some data to control, but want tolimit the number of character of a specific field to a 30 first characters.
I want to do it, if it's possible, on aspx page.
I tried this:
Text='<%# String.Format("{0}", Eval("Title")).Substring(0,30) %> '
But got this error:
Index and length must refer to a
location within the string. Parameter
name: length
-schema
CREATE TABLE `ratings` (
`id` int(11) NOT NULL default '0',
`rating` int(11) NOT NULL default '1',
`rating_start` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) TYPE=MyISAM
-myprogram.php
foreach($ids as $id){
$sql = "SELECT rating FROM ratings WHERE id = '$id' AND rating_start >= NOW()";
$sql .= "ORDER BY rating_start DESC LIMIT 1;"
$ret = $db->execute($id);
}
Can I teke same date from a Query?
by using id IN (".implode(",",$ids).") and GROUP BY id
Hello coders,
Super simple example:
var Path:String="E:\SWF Security\Acess Current Path\Access SWF URL.swf"
var Path1:Array = Path.split("\\") // Split using the backslash as delimiter (No limit the number of returned tokens)
trace(Path1)
What do you expect path1 to be ?
E: ?
No its E:SWF SecurityAcess Current PathAccess SWF URL.swf and i have no idea why.
I'm currently doing this query to find the guy who makes the most calls:
SELECT `commenter_name`, COUNT(*) AS `calls` FROM `comments` GROUP BY `commenter_name` ORDER BY `calls` LIMIT 1
What I want now is to be able to find out how many total unique callers. I tried using DISTINCT but I didn't get anywhere.
From the docs:
If all of a managed object's
relationship delete rules are Nullify,
then for that object at least there is
no additional work to do (you may have
to consider other objects that were at
the destination of the relationship—if
the inverse relationship was either
mandatory or had a lower limit on
cardinality, then the destination
object or objects might be in an
invalid state).
Does someone have an example of this cardinality thing? What's this good for and what's important to know about this? (sounds very important...)
UPDATE polls_options SET `votes`=`votes`+1, `percent`=ROUND((`votes`+1) / (SELECT voters FROM polls WHERE poll_id=? LIMIT 1) * 100,1)
WHERE option_id=?
AND poll_id=?
Don't have table data yet, to test it properly. :)
And by the way, in what type % integers should be stored in database?
Thanks for the help!
I am trying to select the most common 100 names from a table then display the list showing the names and count. I want the user to be able to re-sort the list alphabetically rather than based on count.
I thought the following code would do it. It works for the default sort by count but fails on the sort alphabetically. The line "$count = mysql_num_rows($table);" gives an error: mysql_num_rows() expects parameter 1 to be resource, boolean given. Any help would be greatly appreciated.
// Get most popular surnames
echo '<h2>Most Common Surnames</h2>';
if ($sort == "") { // default sort by count
echo '<a href="http://mysite/names.php?id='.$id.'&sort=name">Sort by name</a><br>';
$query = "SELECT family_name, COUNT(*) as count FROM namefile
WHERE record_key = $id
GROUP BY family_name
ORDER BY count DESC LIMIT 100";
}
else { // sort alphabetically
echo '<a href="http://mysite/names.php?id='.$id.'">Sort by count</a><br>';
$query = "SELECT * FROM (
SELECT family_name, COUNT(*) as count FROM namefile
WHERE record_key = $id
GROUP BY family_name
ORDER BY count DESC LIMIT 100)
AS alpha ORDER BY family_name";
}
$table = mysql_query($query);
$count = mysql_num_rows($table);
$tot = 0;
$i = 0;
echo '<table><tr>';
while ($tot < $count2) {
$rec2 = mysql_fetch_array($table2);
echo '<td>'.$rec2[0].'</td><td>'.$rec2[1].'</td><td width="40"> </td><td>';
if ($i++ == 6) {
echo '</tr><tr>';
$i = 0;
}
$tot++;
}
echo '</tr></table><br>';
UPDATE: I needed to add "AS alpha" to give the outer select a unique name. (alpha is just a random name I made up.) It now works perfectly. Code updated for the benefit of any others who need something similar.
I have the following JSON:
{
"meta": {
"limit": 20,
"next": null,
"offset": 0,
"previous": null,
"total_count": 0
},
"objects": []
}
I'm interested in objects: I want to know if objects is empty and show an alert:
something like this:
success: function (data) {
$.each(data.objects, function () {
if data.objects == None alert(0)
else :alert(1)
});
I want to add a WHERE clause to a full text search query (to limitto past 24 hours), but wherever I insert it I get Low Level Error. Is it possible to add the clause and if so, how? Here is the code WITHOUT the where clause:
$query = "SELECT *, MATCH (story_title) AGAINST ('$query' IN BOOLEAN MODE)
AS Relevance FROM stories WHERE MATCH (story_title) AGAINST ('+$query' IN BOOLEAN MODE)
HAVING Relevance > 0.2 ORDER BY Relevance DESC, story_time DESC;
I want to get file size I'm doing this:
my $filename=$query->param("upload_file");
my $filesize = (-s $filename) ;
print "Size: $filesize ";
Yet it is not working.Note that I did not upload the file. I want to check its size before uploading it. so tolimit it to max of 1 MB.