Reply to oci_define_by_name();

Your name:

Reply:


Posted by Steph on 05/16/06 22:55

Hello everyone,

I have a question concerning oci_define_by_name();

Why do I have to actually print all my variables prior to using them.I mean
if I don't use echo(); function in oci_fetch() function it seems the value
doesn't get into my variable....the value is not assigned to the
$variable...

is it normal?

here is an example of what I do:


//connection to database
include '../connection_DB/connect.php';

$sql= "select a.request_name
,a.request_date
,c.request_type_name
,c.request_type_id
,a.request_wished_delivery_date
,b.client_firstname||' '||b.client_lastname as client_name
,b.client_id
,d.brand_name
,d.brand_id
,a.request_comment
from requests a
,clients b
,request_types c
,brands d
where a.request_client_id = b.client_id
and a.request_request_type_id = c.request_type_id
and a.request_brand_id = d.brand_id
and a.request_id = $reqID";

$stmt = oci_parse($c1, $sql);

// oci_define_by_name defines PHP variables for fetches of
SQL-Columns.Columns need to be
// in UPPERCASE with Oracle

oci_define_by_name($stmt, "REQUEST_NAME", $up_req_name);
oci_define_by_name($stmt, "REQUEST_DATE", $up_req_date);
oci_define_by_name($stmt, "REQUEST_TYPE_NAME", $up_req_typ_name);
oci_define_by_name($stmt, "REQUEST_TYPE_ID", $up_req_typ_id);
oci_define_by_name($stmt, "REQUEST_WISHED_DELIVERY_DATE",
$up_req_wished_date);
oci_define_by_name($stmt, "CLIENT_NAME", $up_req_client_name);
oci_define_by_name($stmt, "CLIENT_ID", $up_req_client_id);
oci_define_by_name($stmt, "BRAND_NAME", $up_req_brand_name);
oci_define_by_name($stmt, "BRAND_ID", $up_req_brand_id);
oci_define_by_name($stmt, "REQUEST_COMMENT", $up_req_comment);

oci_execute($stmt);

while (oci_fetch($stmt))
{
// in white font not to display values on screen

echo "<font color='#FFFFFF'> $up_req_name</font>";
echo "<font color='#FFFFFF'> $up_req_date</font>";
echo "<font color='#FFFFFF'> $up_req_typ_name</font>";
echo "<font color='#FFFFFF'> $up_req_typ_id</font>";
echo "<font color='#FFFFFF'> $up_req_wished_date</font>";
echo "<font color='#FFFFFF'> $up_req_client_name</font>";
echo "<font color='#FFFFFF'> $up_req_client_id</font>";
echo "<font color='#FFFFFF'> $up_req_brand_name</font>";
echo "<font color='#FFFFFF'> $up_req_brand_id</font>";
echo "<font color='#FFFFFF'> $up_req_comment</font>";

}

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация