[1] | 1 | <HTML
|
---|
| 2 | ><HEAD
|
---|
| 3 | ><TITLE
|
---|
| 4 | >ovrimos_fetch_into</TITLE
|
---|
| 5 | ><META
|
---|
| 6 | NAME="GENERATOR"
|
---|
| 7 | CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
---|
| 8 | REL="HOME"
|
---|
| 9 | TITLE="Manuál PHP"
|
---|
| 10 | HREF="index.html"><LINK
|
---|
| 11 | REL="UP"
|
---|
| 12 | TITLE="Ovrimos SQL functions"
|
---|
| 13 | HREF="ref.ovrimos.html"><LINK
|
---|
| 14 | REL="PREVIOUS"
|
---|
| 15 | TITLE="ovrimos_execute"
|
---|
| 16 | HREF="function.ovrimos-execute.html"><LINK
|
---|
| 17 | REL="NEXT"
|
---|
| 18 | TITLE="ovrimos_fetch_row"
|
---|
| 19 | HREF="function.ovrimos-fetch-row.html"><META
|
---|
| 20 | HTTP-EQUIV="Content-type"
|
---|
| 21 | CONTENT="text/html; charset=ISO-8859-2"></HEAD
|
---|
| 22 | ><BODY
|
---|
| 23 | CLASS="refentry"
|
---|
| 24 | BGCOLOR="#FFFFFF"
|
---|
| 25 | TEXT="#000000"
|
---|
| 26 | LINK="#0000FF"
|
---|
| 27 | VLINK="#840084"
|
---|
| 28 | ALINK="#0000FF"
|
---|
| 29 | ><DIV
|
---|
| 30 | CLASS="NAVHEADER"
|
---|
| 31 | ><TABLE
|
---|
| 32 | SUMMARY="Header navigation table"
|
---|
| 33 | WIDTH="100%"
|
---|
| 34 | BORDER="0"
|
---|
| 35 | CELLPADDING="0"
|
---|
| 36 | CELLSPACING="0"
|
---|
| 37 | ><TR
|
---|
| 38 | ><TH
|
---|
| 39 | COLSPAN="3"
|
---|
| 40 | ALIGN="center"
|
---|
| 41 | >Manuál PHP</TH
|
---|
| 42 | ></TR
|
---|
| 43 | ><TR
|
---|
| 44 | ><TD
|
---|
| 45 | WIDTH="10%"
|
---|
| 46 | ALIGN="left"
|
---|
| 47 | VALIGN="bottom"
|
---|
| 48 | ><A
|
---|
| 49 | HREF="function.ovrimos-execute.html"
|
---|
| 50 | ACCESSKEY="P"
|
---|
| 51 | >Pøedcházející</A
|
---|
| 52 | ></TD
|
---|
| 53 | ><TD
|
---|
| 54 | WIDTH="80%"
|
---|
| 55 | ALIGN="center"
|
---|
| 56 | VALIGN="bottom"
|
---|
| 57 | ></TD
|
---|
| 58 | ><TD
|
---|
| 59 | WIDTH="10%"
|
---|
| 60 | ALIGN="right"
|
---|
| 61 | VALIGN="bottom"
|
---|
| 62 | ><A
|
---|
| 63 | HREF="function.ovrimos-fetch-row.html"
|
---|
| 64 | ACCESSKEY="N"
|
---|
| 65 | >Dal¹í</A
|
---|
| 66 | ></TD
|
---|
| 67 | ></TR
|
---|
| 68 | ></TABLE
|
---|
| 69 | ><HR
|
---|
| 70 | ALIGN="LEFT"
|
---|
| 71 | WIDTH="100%"></DIV
|
---|
| 72 | ><H1
|
---|
| 73 | ><A
|
---|
| 74 | NAME="function.ovrimos-fetch-into"
|
---|
| 75 | ></A
|
---|
| 76 | >ovrimos_fetch_into</H1
|
---|
| 77 | ><DIV
|
---|
| 78 | CLASS="refnamediv"
|
---|
| 79 | ><A
|
---|
| 80 | NAME="AEN64493"
|
---|
| 81 | ></A
|
---|
| 82 | ><P
|
---|
| 83 | > (PHP 4 >= 4.0.3)</P
|
---|
| 84 | >ovrimos_fetch_into -- Fetches a row from the result set</DIV
|
---|
| 85 | ><DIV
|
---|
| 86 | CLASS="refsect1"
|
---|
| 87 | ><A
|
---|
| 88 | NAME="AEN64496"
|
---|
| 89 | ></A
|
---|
| 90 | ><H2
|
---|
| 91 | >Description</H2
|
---|
| 92 | >bool <B
|
---|
| 93 | CLASS="methodname"
|
---|
| 94 | >ovrimos_fetch_into</B
|
---|
| 95 | > ( int result_id, array result_array [, string how [, int rownumber]])<BR
|
---|
| 96 | ></BR
|
---|
| 97 | ><P
|
---|
| 98 | > <B
|
---|
| 99 | CLASS="function"
|
---|
| 100 | >ovrimos_fetch_into()</B
|
---|
| 101 | > is used to fetch a row
|
---|
| 102 | from the result set.
|
---|
| 103 | </P
|
---|
| 104 | ><P
|
---|
| 105 | > <B
|
---|
| 106 | CLASS="function"
|
---|
| 107 | >ovrimos_fetch_into()</B
|
---|
| 108 | > fetches a row from the
|
---|
| 109 | result set into 'result_array', which should be passed by
|
---|
| 110 | reference. Which row is fetched is determined by the two last
|
---|
| 111 | parameters. 'how' is one of 'Next' (default), 'Prev', 'First',
|
---|
| 112 | 'Last', 'Absolute', corresponding to forward direction from
|
---|
| 113 | current position, backward direction from current position,
|
---|
| 114 | forward direction from the start, backward direction from the end
|
---|
| 115 | and absolute position from the start (essentially equivalent to
|
---|
| 116 | 'first' but needs 'rownumber'). Case is not
|
---|
| 117 | significant. 'Rownumber' is optional except for absolute
|
---|
| 118 | positioning. Returns <TT
|
---|
| 119 | CLASS="constant"
|
---|
| 120 | ><B
|
---|
| 121 | >TRUE</B
|
---|
| 122 | ></TT
|
---|
| 123 | > or <TT
|
---|
| 124 | CLASS="constant"
|
---|
| 125 | ><B
|
---|
| 126 | >FALSE</B
|
---|
| 127 | ></TT
|
---|
| 128 | >.
|
---|
| 129 | </P
|
---|
| 130 | ><P
|
---|
| 131 | > <TABLE
|
---|
| 132 | WIDTH="100%"
|
---|
| 133 | BORDER="0"
|
---|
| 134 | CELLPADDING="0"
|
---|
| 135 | CELLSPACING="0"
|
---|
| 136 | CLASS="EXAMPLE"
|
---|
| 137 | ><TR
|
---|
| 138 | ><TD
|
---|
| 139 | ><DIV
|
---|
| 140 | CLASS="example"
|
---|
| 141 | ><A
|
---|
| 142 | NAME="AEN64520"
|
---|
| 143 | ></A
|
---|
| 144 | ><P
|
---|
| 145 | ><B
|
---|
| 146 | >Pøíklad 1. A fetch into example</B
|
---|
| 147 | ></P
|
---|
| 148 | ><TABLE
|
---|
| 149 | BORDER="0"
|
---|
| 150 | BGCOLOR="#E0E0E0"
|
---|
| 151 | CELLPADDING="5"
|
---|
| 152 | ><TR
|
---|
| 153 | ><TD
|
---|
| 154 | ><PRE
|
---|
| 155 | CLASS="php"
|
---|
| 156 | ><?php
|
---|
| 157 | $conn=ovrimos_connect ("neptune", "8001", "admin", "password");
|
---|
| 158 | if ($conn!=0) {
|
---|
| 159 | echo "Connection ok!";
|
---|
| 160 | $res=ovrimos_exec ($conn,"select table_id, table_name from sys.tables");
|
---|
| 161 | if ($res != 0) {
|
---|
| 162 | echo "Statement ok!";
|
---|
| 163 | if (ovrimos_fetch_into ($res, &$row)) {
|
---|
| 164 | list ($table_id, $table_name) = $row;
|
---|
| 165 | echo "table_id=".$table_id.", table_name=".$table_name."\n";
|
---|
| 166 | if (ovrimos_fetch_into ($res, &$row)) {
|
---|
| 167 | list ($table_id, $table_name) = $row;
|
---|
| 168 | echo "table_id=".$table_id.", table_name=".$table_name."\n";
|
---|
| 169 | } else {
|
---|
| 170 | echo "Next: error\n";
|
---|
| 171 | }
|
---|
| 172 | } else {
|
---|
| 173 | echo "First: error\n";
|
---|
| 174 | }
|
---|
| 175 | ovrimos_free_result ($res);
|
---|
| 176 | }
|
---|
| 177 | ovrimos_close($conn);
|
---|
| 178 | }
|
---|
| 179 | ?></PRE
|
---|
| 180 | ></TD
|
---|
| 181 | ></TR
|
---|
| 182 | ></TABLE
|
---|
| 183 | ></DIV
|
---|
| 184 | ></TD
|
---|
| 185 | ></TR
|
---|
| 186 | ></TABLE
|
---|
| 187 | >
|
---|
| 188 | This example will fetch a row.
|
---|
| 189 | </P
|
---|
| 190 | ></DIV
|
---|
| 191 | ><DIV
|
---|
| 192 | CLASS="NAVFOOTER"
|
---|
| 193 | ><HR
|
---|
| 194 | ALIGN="LEFT"
|
---|
| 195 | WIDTH="100%"><TABLE
|
---|
| 196 | SUMMARY="Footer navigation table"
|
---|
| 197 | WIDTH="100%"
|
---|
| 198 | BORDER="0"
|
---|
| 199 | CELLPADDING="0"
|
---|
| 200 | CELLSPACING="0"
|
---|
| 201 | ><TR
|
---|
| 202 | ><TD
|
---|
| 203 | WIDTH="33%"
|
---|
| 204 | ALIGN="left"
|
---|
| 205 | VALIGN="top"
|
---|
| 206 | ><A
|
---|
| 207 | HREF="function.ovrimos-execute.html"
|
---|
| 208 | ACCESSKEY="P"
|
---|
| 209 | >Pøedcházející</A
|
---|
| 210 | ></TD
|
---|
| 211 | ><TD
|
---|
| 212 | WIDTH="34%"
|
---|
| 213 | ALIGN="center"
|
---|
| 214 | VALIGN="top"
|
---|
| 215 | ><A
|
---|
| 216 | HREF="index.html"
|
---|
| 217 | ACCESSKEY="H"
|
---|
| 218 | >Domù</A
|
---|
| 219 | ></TD
|
---|
| 220 | ><TD
|
---|
| 221 | WIDTH="33%"
|
---|
| 222 | ALIGN="right"
|
---|
| 223 | VALIGN="top"
|
---|
| 224 | ><A
|
---|
| 225 | HREF="function.ovrimos-fetch-row.html"
|
---|
| 226 | ACCESSKEY="N"
|
---|
| 227 | >Dal¹í</A
|
---|
| 228 | ></TD
|
---|
| 229 | ></TR
|
---|
| 230 | ><TR
|
---|
| 231 | ><TD
|
---|
| 232 | WIDTH="33%"
|
---|
| 233 | ALIGN="left"
|
---|
| 234 | VALIGN="top"
|
---|
| 235 | >ovrimos_execute</TD
|
---|
| 236 | ><TD
|
---|
| 237 | WIDTH="34%"
|
---|
| 238 | ALIGN="center"
|
---|
| 239 | VALIGN="top"
|
---|
| 240 | ><A
|
---|
| 241 | HREF="ref.ovrimos.html"
|
---|
| 242 | ACCESSKEY="U"
|
---|
| 243 | >Nahoru</A
|
---|
| 244 | ></TD
|
---|
| 245 | ><TD
|
---|
| 246 | WIDTH="33%"
|
---|
| 247 | ALIGN="right"
|
---|
| 248 | VALIGN="top"
|
---|
| 249 | >ovrimos_fetch_row</TD
|
---|
| 250 | ></TR
|
---|
| 251 | ></TABLE
|
---|
| 252 | ></DIV
|
---|
| 253 | ></BODY
|
---|
| 254 | ></HTML
|
---|
| 255 | >
|
---|