Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.php > #4214

Re: OCI8

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups de.comp.lang.php
Subject Re: OCI8
Date 2017-08-21 22:56 +0200
Organization solani.org
Message-ID <onfhdg$4t8$1@solani.org> (permalink)
References <f00o39Fpq2dU1@mid.individual.net> <f00om4Fpub7U1@mid.individual.net>

Show all headers | View raw


Am 21.08.2017 um 20:56 schrieb Claus Reibenstein:

> Jörg Burzeja schrieb am 21.08.2017 um 20:45:
> 
>> $stid = oci_parse($conn, 'SELECT * FROM employees where first_name = 
>> ''Lisa''');
> 
> ... diesen syntaktischen PHP-Müll erkennt man auch ohne ORACLE-Kenntnisse.
> 
> Versuch's mal hiermit:
> 
> $stid = oci_parse($conn, "SELECT * FROM employees where first_name =
> 'Lisa'");

Oder vielleicht besser:

    $stdi = oci_parse(
        $conn, 'SELECT * FROM employees where first_name = :first_name'
    );
    oci_bind_by_name($stdid, ':first_name', 'Lisa');

Solange es sich bei dem Wert um ein Literal handelt, braucht man
natürlich nicht zu "binden" – das sieht allerdings anders aus, wenn man
nach User-Input selektieren will.

-- 
Christoph M. Becker

Back to de.comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

OCI8 Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2017-08-21 20:45 +0200
  Re: OCI8 Claus Reibenstein <4spamersonly@kabelmail.de> - 2017-08-21 20:56 +0200
    Re: OCI8 Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2017-08-21 21:06 +0200
    Re: OCI8 "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-08-21 22:56 +0200
      Re: OCI8 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-22 14:43 +0200
        Re: OCI8 "Christoph M. Becker" <cmbecker69@arcor.de> - 2017-08-22 15:51 +0200
    Re: OCI8 Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2017-08-22 21:50 +0200
      Re: OCI8 Stefan+Usenet@Froehlich.Priv.at (Stefan Froehlich) - 2017-08-22 20:36 +0000
        Re: OCI8 Jörg Burzeja <No_Spam_burzeja@gmx.de> - 2017-08-22 22:58 +0200
          Re: OCI8 Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-08-28 01:08 +0200

csiph-web