Re: Re: Newbie: odbc_prepare & parameters

From: Date: Fri, 19 Oct 2001 10:29:25 +0000
Subject: Re: Re: Newbie: odbc_prepare & parameters
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-13527@lists.php.net to get a copy of this message
Hi Rick, no, where the '?' stands should be the value of the parameter given by the odbc_execute function. And this value changes everytime when a new result row of the other query is selected. Michael "Rick Emery" <remery@excel.com> schrieb im Newsbeitrag news:EAA093B474ABD311A71E00508B5FE08305C2CAD7@adntex03.us.excel.com... > Does fldFlight contain the character "?" > > If it does, you must use: WHERE fldFlight='?' > > Are you using ? as a wildcard? > > -----Original Message----- > From: Michael J. Eisner [mailto:michael.eisner@utanet.at] > Sent: Thursday, October 18, 2001 12:53 PM > To: php-db@lists.php.net > Subject: [PHP-DB] Re: Newbie: odbc_prepare & parameters > > > Hi all, > > sorry, there was a mistake: > > > $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty, > > fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown > > FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#"; > > should read > > FROM tblBookings WHERE fldFlight = ? AND fldBookDate =#".$EngDatum."#"; > ^^^^^^ > there should the parameter be used. > > Michael Eisner > > > "Michael J. Eisner" <michael.eisner@utanet.at> schrieb im Newsbeitrag > news:20011018163048.66887.qmail@pb1.pair.com... > > Hi all, > > i'm really new in php (working on my first project9 and i got the > following > > situation: > > > > i have a loop going through a result set of an odbc-query. each row of > this > > loop has to be checked if there is an entry in another table. so as the > last > > odbc-query is the same for each row except they key-field, i tried to use > > the odbc_prepare function and a parameter array. but it doesn't work. > > I got no errormessages. > > > > this is how it looks like - and doesn't work: > > ****** > > ... > > ... > > $sql="SELECT fldCaptain, fldCaptID, fldCaptStat, fldCaptTR, fldCaptDuty, > > fldFO, fldFOID, fldFOStat, fldFOTR, fldFODuty, fld_F_Reserved, fld_F_Flown > > FROM tblBookings WHERE fldFlight = '?' AND fldBookDate =#".$EngDatum."#"; > > > > $ergDispatch=odbc_prepare($conDispatch,$sql); > > > > While (odbc_fetch_into($ergRouten, &$datRouten)) > > ... > > ... > > $Para = array($datRouten[0]); > > odbc_execute($ergDispatch,$Para); > > ... > > ... > > ***** > > The array is filled correctly, but the odbc_execute function doesNn't > bring > > back any value, but there are definitvly rows where there should be a > > result. > > > > Thanks in advance! > > > > Michael J. Eisner > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#13527) next »