Re: [PHP-DB] Skipping a row

2003-12-19 Thread Robby Russell
John Greco wrote:
 $sql2 = "select * from product where whseNum = '".$whseNumber."' order by
prodNum";
What does your PHP code look like after that? What is your index 
starting with?

are you starting with 0? or 1?

$sql = "SELECT id FROM product WHERE something = this";
$rs = pg_query($sql);
$i = 0; //not needed, but to show what is is to start with

while ($i < pg_numrows($sql)) {
  print pg_fetch_result($rs, $i, id) . "\n";
  $i++;  // increment
}
// done

-Robby

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


Re: [PHP-DB] Skipping a row

2003-12-18 Thread John Greco
 $sql2 = "select * from product where whseNum = '".$whseNumber."' order by
prodNum";

"Fedde Van Feggelen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> >I have a select statement that goes to my mySQL db and selects some data
> >from there. I thought it was working great BUT it is skipping the first
row.
> >Any ideas? I know it has to be somehting simple I am missing.
>
> What is the SQL statement you're currently using?
>
>
> Fedde
>
> ~=There's a fine line between genius and insanity. I have erased this
line=~

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



Re: [PHP-DB] Skipping a row

2003-12-18 Thread Fedde van Feggelen

I have a select statement that goes to my mySQL db and selects some data
from there. I thought it was working great BUT it is skipping the first row.
Any ideas? I know it has to be somehting simple I am missing.
What is the SQL statement you're currently using?

Fedde

~=There's a fine line between genius and insanity. I have erased this line=~

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


Re: [PHP-DB] Skipping a row

2003-12-18 Thread Martin Marques
El Jue 18 Dic 2003 18:27, John Greco escribió:
> I have a select statement that goes to my mySQL db and selects some data
> from there. I thought it was working great BUT it is skipping the first row.
> Any ideas? I know it has to be somehting simple I am missing.

Depends on how you are fetching your rows. I think you have to start with the 
row 0 on some databases.

I personally don't have to think much of that since I use PEAR::DB. :-)

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telemática
   Universidad Nacional
del Litoral
-

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