My post below works but is *not* the correct way. It only works because of default behavior. I'll re-post my understanding of what is "correct" soon.
Ingres II Funktionen
Inhaltsverzeichnis
- ingres_autocommit — Schaltet den autocommit-Modus an oder aus
- ingres_close — Schliesst eine Ingres II Datenbankverbindung
- ingres_commit — Schliesst eine Transaktion ab
- ingres_connect — Eine Verbindung zu einem Ingres II Datenbankserver öffnen
- ingres_cursor — Gets a cursor name for a given link resource
- ingres_errno — Gets the last ingres error number generated
- ingres_error — Gets a meaningful error message for the last error generated
- ingres_errsqlstate — Gets the last SQLSTATE error code generated
- ingres_fetch_array — Liest eine Zeile der Ergebnismenge in ein Array ein
- ingres_fetch_object — Holt eine Zeile als Objekt
- ingres_fetch_row — Holt eine Zeile aus einer Ergebnismenge in ein numerisches Array
- ingres_field_length — Gibt die Länge eines Feldes zurück
- ingres_field_name — Holt den Namen eines Feldes in einer Ergebnismenge
- ingres_field_nullable — Prüft, ob für ein Feld NULL-Werte zugelassen sind
- ingres_field_precision — Gibt die Genauigkeit eines Feldes zurück
- ingres_field_scale — Gibt den Skalar eines Feldes zurück
- ingres_field_type — Gibt den Typ eines Feldes in einer Ergebnismenge zurück
- ingres_num_fields — Gibt die Anzahl der Felder der letzten Abfrage zurück
- ingres_num_rows — Gibt die Anzahl der Datensätze der Ergebnismenge zurück oder die Anzahl der von der letzten Abfrage betroffenen Datensätze
- ingres_pconnect — Öffnet eine persistente Verbindung zu einem Ingres II Datenbankserver
- ingres_query — Sendet eine SQL Abfrage an den Ingres II Server
- ingres_rollback — Setzt eine Transaktion zurück
Ingres II Funktionen
corysbrain-ondrugs at yahoo dot com
07-Jul-2007 09:04
07-Jul-2007 09:04
corysbrain-ondrugs at yahoo dot com
13-Feb-2007 06:57
13-Feb-2007 06:57
On the three versions of Linux/Ingres I've worked on, I've always had to modify the following line in the example above:
while ($iirelation = ingres_fetch_object($link)) {
to:
while ($iirelation = ingres_fetch_object()) {
If not, PHP will return "Undefined property" notices.
However, it's my understanding that the following is the proper way to access the database (it works as expected):
<?php
// Connecting, selecting database
$link = ingres_connect('database', 'user', 'password')
or die('Could not connect: ' . ingres_error($link));
echo 'Connected successfully';
// Select from a table that exists in all Ingres databases
$query = 'SELECT * FROM iirelation';
$rs = ingres_query($query,$link) or die('Query failed: ' .
ingres_error($link));
// Print results in HTML
// relid - table name
// relowner - table owner
echo "<table>\n";
while ($iirelation = ingres_fetch_object($rs)) {
echo "\t<tr>\n";
echo "\t\t<td>" . $iirelation->relid . "</td>\n";
echo "\t\t<td>" . $iirelation->relowner . "</td>\n";
echo "\t</tr>\n";
}
echo "</table>\n";
// Commit transaction
ingres_commit($link);
// Closing connection
ingres_close($link);
?>
mail at hannes-reinecke dot de
12-Dec-2002 03:09
12-Dec-2002 03:09
If you try to use the 'Embedded Ingres' as it is delivered with certain CA products (e.g. TNG UHD), the referenced library '-lingres' is not available. You need to add '-lq -lframe' instead.
burckhardtNOSPAM at SNIPITOFFgsf dot de
23-Jan-2002 10:07
23-Jan-2002 10:07
Hi,
I am currently migrating from MySQL to Ingres. Generally, almost ALL INGRES-functions that use arrays start with counter=1, NOT counter=0. Also, whereas MySQL-functions use $result as an argument, INGRES-functions use $connection instead.
Florian
