Hi all at TheScripts.com,
I am doing PHP and Mssql on windows xp 32bit.
this is my first post since working on 'PHP odbc error, with no error' and this inturn follows on from that...by the way id like to thank again....
my table output is:
[php]
while($_rs = odbc_fetch_arra y($result))
{
echo '<tr>';
echo '<td>'.$_rs['STAMP'] . '     '.'</td>' ;
echo '<td>'.$_rs['ALIAS'] . '     '.'</td>' ;
echo '<td>'.$_rs['ID'].'</td>' ;
echo '</tr>';
}
[/php]
I managed to get my table to output to the screeen with alot of hassle, thankgod.
i have my table that is printed out to the webpage as required, the query that selects the data is partly formed by a javascript date picker class which is clicked by a user and the parameters are passed to another page where the mssql query is....and so the query is executed.
my problem is that i have printed out a view, which is stored in my mssql database - and is essentially an abbreviated version of the events table that it is derived from.
What i would like to do, is to be able to allow the user of my page to click on each and every row in that view, each uniquely indentified by the 'id' field.
when the row of the table is clicked,which could potentially hold a couple of thousand rows (i.e. we couldnt do it statically), i would like it so that the page links to another page where the same row is displayed but in its full, i.e. for the same id, select * from events ( and not from v1);
The view is called v1, and the table is called events; where v1 is essentially abbreviated version of events...
in the events table, we have defined the id field as an auto increment of an integer type. and the other field that is stored in v1 is the 'stamp' field, which holds the corresponding timestamp for that particular id ( which is retrieved from the events table).
the page that it is linked to, is simply that single row, but pulled from 'events' and not from 'v1'.
does anyone have an idea about where to beging...bearin g in mind that i have no experience of javascript at all?
and my 2nd but Smaller Q is,
when i run the query
i get a result in mssql management studio 2005, however the resulting column has no name, so how do you then print it out to the screen on my php application/webpage?
i tried to use odbc_num_rows($ result); where
but i get a result of '-1'. and i have read that you cannot run odbc_num_rows on an odbc_exec() function; so how then do you return it, and then display the result.
the point it, that to print out columns from my table i use the code
for e.g.
meaning that i am 'asking' for the element of the array $_rs[] that is called 'stamp'.... what do i do for no column name???
please could someone offer any help!
appreciated mostly, however my 1st Q is of much more importance....
i hope that you can all understand my english, but please please give me a shout if any further explanaition is required.
2DIL
I am doing PHP and Mssql on windows xp 32bit.
this is my first post since working on 'PHP odbc error, with no error' and this inturn follows on from that...by the way id like to thank again....
my table output is:
[php]
while($_rs = odbc_fetch_arra y($result))
{
echo '<tr>';
echo '<td>'.$_rs['STAMP'] . '     '.'</td>' ;
echo '<td>'.$_rs['ALIAS'] . '     '.'</td>' ;
echo '<td>'.$_rs['ID'].'</td>' ;
echo '</tr>';
}
[/php]
I managed to get my table to output to the screeen with alot of hassle, thankgod.
i have my table that is printed out to the webpage as required, the query that selects the data is partly formed by a javascript date picker class which is clicked by a user and the parameters are passed to another page where the mssql query is....and so the query is executed.
my problem is that i have printed out a view, which is stored in my mssql database - and is essentially an abbreviated version of the events table that it is derived from.
What i would like to do, is to be able to allow the user of my page to click on each and every row in that view, each uniquely indentified by the 'id' field.
when the row of the table is clicked,which could potentially hold a couple of thousand rows (i.e. we couldnt do it statically), i would like it so that the page links to another page where the same row is displayed but in its full, i.e. for the same id, select * from events ( and not from v1);
The view is called v1, and the table is called events; where v1 is essentially abbreviated version of events...
in the events table, we have defined the id field as an auto increment of an integer type. and the other field that is stored in v1 is the 'stamp' field, which holds the corresponding timestamp for that particular id ( which is retrieved from the events table).
the page that it is linked to, is simply that single row, but pulled from 'events' and not from 'v1'.
does anyone have an idea about where to beging...bearin g in mind that i have no experience of javascript at all?
and my 2nd but Smaller Q is,
when i run the query
Code:
$stamp = "select count(*) from v1"
i tried to use odbc_num_rows($ result); where
Code:
$result = odbc_exec($connect,$stamp)
the point it, that to print out columns from my table i use the code
for e.g.
Code:
while($_rs = odbc_fetch_array($result))
{
echo '<tr>';
echo '<td>'.$_rs['stamp'] . '        '.'</td>' ;
echo '</tr>';
}
meaning that i am 'asking' for the element of the array $_rs[] that is called 'stamp'.... what do i do for no column name???
please could someone offer any help!
appreciated mostly, however my 1st Q is of much more importance....
i hope that you can all understand my english, but please please give me a shout if any further explanaition is required.
2DIL
Comment