473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to limit the values in array variable?

50
hi
In my code i have sorted the high_score
through this
arsort($highscore_user);
// $highscore_user is associated array(i.e. id=>score)
Now i want limit it ,say 10 sorted array value of it.
How to do it


Regards
Sid
Dec 16 '10 #1
6 2040
johny10151981
1,059 1GB
try this
Dec 16 '10 #2
sidhx
50
hey johny i just want to remove excess value from this $highscore_user.
Dec 16 '10 #3
johny10151981
1,059 1GB
copy to another array
Dec 16 '10 #4
sidhx
50
hi johny i got sorted out.
Can help me in this,Can i send array value like
$lang=array('Programmer', 'Senior Programmer', and so on...)
to this



SELECT f_name, l_name, title from
employee_data where title IN
(___________Some what here $lang_____________);

instead of this way

SELECT f_name, l_name, title from
employee_data where title IN
('Programmer', 'Senior Programmer',
'Multimedia Programmer');

bz $lang varies constantly
Dec 17 '10 #5
johny10151981
1,059 1GB
certainly you can just check foreach iterator. you will get the idea properly.

its simple
Dec 17 '10 #6
sidhx
50
i know to use foreach loop but its not the efficient(mean its takes more time) way to do query so i ask other way round
Dec 19 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: MC | last post by:
Hi to all, I would like to use in a XSL stylesheet an array variable which is defined in a Java program. For example, in my program, i defined a tab variable String tab = {"first", "second",...
2
by: Augusto Cesar | last post by:
Hello people. How can I Pass ASP Array variable to Javascript; I´m to trying this: <script language="JavaScript"> var x = new Array(10);
2
by: satish kumar | last post by:
Hi I'm Satish Kumar, new member of a group. Is it possible to access a server side(VB.NET) array variable from Client Side(Javascript) My VB Page Code: Public x() As Integer ...
5
by: Mercy | last post by:
I guess my C++ is pretty darn rusty. I was just looking over sample C++ code for practice... and I'm kind of confused about this code fragment: int sector2; int i = 3; memset(sector2,...
4
by: nibakshi | last post by:
As i have defined a structure in EXEC SQL BEGIN and END section and i am declaring a structure type array variable after structure definition,but during precompilation it is throwing an error: "...
1
by: Raju5725 | last post by:
Hi All, I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets.... Thanks in advance. Senario is like this..... ...
3
by: Bilbo0a | last post by:
I am trying to save a integer array variable to a file. I am looking for the easier way to do this then going through all items and converting them to a str and then saving them as a text file. ...
4
by: Blackwater | last post by:
There's an old database system called "PICK" - still in use in various forms such as 'OpenQM' - wherein you can SELECT or READ directly into an array variable. For example : "SELECT * FROM...
3
by: Samant.Trupti | last post by:
HI, I want to dynamically allocate array variable of type LPWSTR. Code looks like this... main() { LPWSTR *wstr; int count = Foo (wstr); for (int i = 0; i < count; i++) //print each...
28
by: Trups | last post by:
HI, I want to dynamically allocate array variable of type LPWSTR. Code looks like this... main() { LPWSTR *wstr; int count = Foo (wstr); for (int i = 0; i < count; i++)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.