Tomasz Golebiowski
|
| Posted: 02/26/2002, 4:09 AM |
|
when I try to select some values from db using:
$newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
log_operacje_id >= 47");
echo $newsy_www;
I receive Resource id #13 on screen..
Can anybody explain this?
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 02/26/2002, 4:33 AM |
|
It's not error . It's like it should be. A kind of resource indetifier ,
resource handle.
If you want to print out results of sql statement you should
$newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
log_operacje_id >= 47");
if ($db->next_record()) {
echo $db->f("log_operacje_nazwa");
}
or use dlookup function
--
Alex
CodeCharge Developer
"Tomasz Golebiowski" <tomasz@REMOVENOSPAMmax.pl> wrote in message
news:a5fttn$ic4$1@news.codecharge.com...
> when I try to select some values from db using:
>
> $newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
> log_operacje_id >= 47");
> echo $newsy_www;
>
> I receive Resource id #13 on screen..
> Can anybody explain this?
>
>
|
|
|
 |
Tomasz Golebiowski
|
| Posted: 02/26/2002, 5:31 AM |
|
OK, but this returns only one record with log_operacje_id = 47 (code in open
form event)
i.e. I need values >=47 and =<51
If code is in form before show, there are many identical values from field
'log_operacje_nazwa', like:
News WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
dodanie
this is value from record with log_operacje_id = 47 duplicated 20 times, and
this number have no relation with anything I can find in db
"Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
news:a5fvap$kom$2@news.codecharge.com...
> It's not error . It's like it should be. A kind of resource indetifier ,
> resource handle.
> If you want to print out results of sql statement you should
>
> $newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
> log_operacje_id >= 47");
>
> if ($db->next_record()) {
> echo $db->f("log_operacje_nazwa");
> }
>
> or use dlookup function
>
> --
> Alex
> CodeCharge Developer
>
>
> "Tomasz Golebiowski" <tomasz@REMOVENOSPAMmax.pl> wrote in message
>news:a5fttn$ic4$1@news.codecharge.com...
> > when I try to select some values from db using:
> >
> > $newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
> > log_operacje_id >= 47");
> > echo $newsy_www;
> >
> > I receive Resource id #13 on screen..
> > Can anybody explain this?
> >
> >
>
>
|
|
|
 |
Kenneth E. Lussier
|
| Posted: 02/26/2002, 8:30 AM |
|
In the WHERE part of the statement, do 'WHERE log_operacje = 47
OR log_operacje > 47'. Some times the SQL server doesn't like the
standard operators put together. Don't know why, though.
Kenny
Tomasz Golebiowski wrote:
>
> OK, but this returns only one record with log_operacje_id = 47 (code in open
> form event)
> i.e. I need values >=47 and =<51
>
> If code is in form before show, there are many identical values from field
> 'log_operacje_nazwa', like:
> News WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
> dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
> dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
> dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW dodanieNews WWW
> dodanie
>
> this is value from record with log_operacje_id = 47 duplicated 20 times, and
> this number have no relation with anything I can find in db
>
> "Alexey Alexapolsky" <alexa@codecharge.com> wrote in message
>news:a5fvap$kom$2@news.codecharge.com...
> > It's not error . It's like it should be. A kind of resource indetifier ,
> > resource handle.
> > If you want to print out results of sql statement you should
> >
> > $newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
> > log_operacje_id >= 47");
> >
> > if ($db->next_record()) {
> > echo $db->f("log_operacje_nazwa");
> > }
> >
> > or use dlookup function
> >
> > --
> > Alex
> > CodeCharge Developer
> >
> >
> > "Tomasz Golebiowski" <tomasz@REMOVENOSPAMmax.pl> wrote in message
> >news:a5fttn$ic4$1@news.codecharge.com...
> > > when I try to select some values from db using:
> > >
> > > $newsy_www = $db->query("select log_operacje_nazwa from log_operacje where
> > > log_operacje_id >= 47");
> > > echo $newsy_www;
> > >
> > > I receive Resource id #13 on screen..
> > > Can anybody explain this?
> > >
> > >
> >
> >
--
----------------------------------------------------------------------------
"The hardest thing in this world, is to live in it..."
Kenneth E. Lussier
Sr. Systems Administrator
Zuken, USA
(978)692-4900 ext. 277
PGP KeyID CB254DD0 http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xCB254DD0
|
|
|
 |
Tomasz Golebiowski
|
| Posted: 02/26/2002, 8:48 AM |
|
ok, I will describe it from the beginning
I have 2 tables: 'log' and 'log_operacje'
'log' contains: log_id, log_target_id, log_operacja,
'log_operacje' contains: log_operacje_id, log_operacje_nazwa
Second table stores almost 80 pairs of id and operation descriptions, e.g.:
'1';'user add', '2';'user delete', '3';'product update' etc.
First table stores full log info (entered by custom sql in update events).
'log_id' is index key, 'log_target_id' is id taken from updated record,
'log_operacja' stores 'log_operacje_id' from second table. 'Log' table is
displayed on grid page, and number from 'log_operacja' is translated to
description taken from second table.
I want also to display 'log_target_id; as a hyperlink, but different hyperlink
depending on content of 'log_operacja'.
I mean if 'log_operacja' contains number X, hyperlink have to open Page1 with
detailed record, if number is Y, Page2 should be opened, and so on. Condition
won't be like: "equal to X", but rather: "is between X and Y". This could be
easy done in before show event.
Problem is I cannot compare content of $fldlog_operacja variable, becouse it's
already changed from number to description. I have to manually select numbers I
need from 2nd table. Result of db select should contain a few text strings
which can be compared with $fld variables. I said 'a few', becouse condition
could be i.e.: >=47 and =<51 (in this case 5 values).
All of them should be used later to display proper hyperlink (I have over 10
different pages for displaying various types of records from db).
How to achieve this?
Hope someone will help..
|
|
|
 |
|