[PHP-DB] PHP Arrays

2004-04-04 Thread Martin Oettinger
Does anyone know up to which level arrays in variables are possible? Is
there a limit?
$foo[1][2][3][4][5][6] ... ?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PHP Arrays

2004-04-04 Thread Bruno Ferreira
Martin Oettinger wrote:

Does anyone know up to which level arrays in variables are possible? Is
there a limit?
$foo[1][2][3][4][5][6] ... ?
 

   I feel the right answer is why do you ask? It's either some very 
complex thing you're doing there, or you're doing it the wrong way :)

   Bruno Ferreira
---
[This E-mail scanned for viruses by Declude Virus]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] How to get only 2nd row in result set ???

2004-04-04 Thread Kim Steinhaug
I would say the same, do the query and then a loop through the results.
Skip the first one and output the second,

eg.

$levels = mysql_query(SELECT levelID from hf_levels ORDER BY levelorder
 RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error());
for($i=0;$imysql_num_rows($levels);$i++){
 $item = mysql_fetch_object($levels);
 if($i){
 // Do the output with the new object, $item
 break;
 }
}


-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

Mikhail U. Petrov [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi!
 But what's the problem?
 You can use mysql_fetch_array() 2 times.
 But may be I understood question not correctly...


 Friday, April 2, 2004, 10:06:05 PM, -{ wrote:

 RB I couldn't find anything like this from my archive searches ... so
here goes:

 RB I've got this query:

 RB $levels = mysql_query(SELECT levelID from hf_levels ORDER BY
levelorder
 RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error());

 RB but I can't figure out how to write the rest of the code ... I need to
skip
 RB the first row and get the data from the 2nd row... but because there's
an
 RB optional up to 255 possible rows in this table, and the order of these
are
 RB determined by a user customizable field called levelorder ... so I
can't
 RB just pick the specific numrows - 1 ... :-/

 RB I know this is a kludge to do it this way ... but it's what I need for
now
 RB ... later I'll get to do it a more brilliant way...


 RB TIA

 RB Rene
 RB -- 
 RB Rene Brehmer
 RB aka Metalbunny

 RB ~ If you don't like what I have to say ... don't read it ~

 RB http://metalbunny.net/
 RB References, tools, and other useful stuff...
 RB Check out the new Metalbunny forums @ http://forums.metalbunny.net/



 -- 
 Best regards,
 Mikhail U. Petrov
 mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP-DB] How to get only 2nd row in result set ???

2004-04-04 Thread Aitziber Hernndez

KS  $item = mysql_fetch_object($levels);
probe with  $item = mysql_fetch_rows($levels);

 
 Aitzi

[EMAIL PROTECTED]

--
domingo, 04 de abril de 2004, 22:17:41, escribiste:

KS I would say the same, do the query and then a loop through the results.
KS Skip the first one and output the second,

KS eg.

KS $levels = mysql_query(SELECT levelID from hf_levels ORDER BY levelorder
 RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error());
KS for($i=0;$imysql_num_rows($levels);$i++){
KS  $item = mysql_fetch_object($levels);
KS  if($i){
KS  // Do the output with the new object, $item
KS  break;
KS  }
KS }


KS -- 
KS -- 
KS Kim Steinhaug
KS --
KS There are 10 types of people when it comes to binary numbers:
KS those who understand them, and those who don't.
KS --
KS www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
KS --

KS Mikhail U. Petrov [EMAIL PROTECTED] wrote in message
KS news:[EMAIL PROTECTED]
 Hi!
 But what's the problem?
 You can use mysql_fetch_array() 2 times.
 But may be I understood question not correctly...


 Friday, April 2, 2004, 10:06:05 PM, -{ wrote:

 RB I couldn't find anything like this from my archive searches ... so
KS here goes:

 RB I've got this query:

 RB $levels = mysql_query(SELECT levelID from hf_levels ORDER BY
KS levelorder
 RB DESC LIMIT 2) or die('Unable to get levelsbr'.mysql_error());

 RB but I can't figure out how to write the rest of the code ... I need to
KS skip
 RB the first row and get the data from the 2nd row... but because there's
KS an
 RB optional up to 255 possible rows in this table, and the order of these
KS are
 RB determined by a user customizable field called levelorder ... so I
KS can't
 RB just pick the specific numrows - 1 ... :-/

 RB I know this is a kludge to do it this way ... but it's what I need for
KS now
 RB ... later I'll get to do it a more brilliant way...


 RB TIA

 RB Rene
 RB -- 
 RB Rene Brehmer
 RB aka Metalbunny

 RB ~ If you don't like what I have to say ... don't read it ~

 RB http://metalbunny.net/
 RB References, tools, and other useful stuff...
 RB Check out the new Metalbunny forums @ http://forums.metalbunny.net/



 -- 
 Best regards,
 Mikhail U. Petrov
 mailto:[EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Drop down menu with PHP

2004-04-04 Thread The Image Builder
Hello,

I have code for a drop down menu that works fine.  But, though I only want
the results from one row to fill the form, I want it to show 2 rows in the
drop down menu.  Can I do that? I would appreciate your help.  Here is what
I have now:

? mysql_connect(localhost,user,password);
mysql_select_db(database);
$sql = select distinct category from books ORDER BY category ASC;
$makes_result = mysql_query($sql);
print (select name=\category\\n);
print(option selected value=\\Please select a
Category/option\n);
while($row = mysql_fetch_row($makes_result))
{
print(option value=\$row[0]\$row[0]/option\n);
}
print(/select); ?

Thanks in advance
   Charles

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Drop down menu with PHP

2004-04-04 Thread Jason Wong
On Monday 05 April 2004 10:01, The Image Builder wrote:

 I have code for a drop down menu that works fine.  But, though I only want
 the results from one row to fill the form, I want it to show 2 rows in the
 drop down menu.  

What exactly do you mean by that? If you want to increase the size of the drop 
down box so that it displays 2 rows at a time then it is an HTML question and 
the anwser can be found in any decent HTML reference. Otherwise please 
elaborate.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Home is the place where, when you have to go there, they have to take you in.
-- Robert Frost, The Death of the Hired Man
*/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php