Help Oracle 10g+PHP and Bengali language support !!!!

Hi All:
i have a emp having a column names namewhich is of nvarchar2 datatype. What I want is to insert a value from a html from which will insert Bengali language as my input to the name filed in my database and show me the same on the browser when required.
Here am attaching a sample code which am using to connect/insert and show my table. This is working perfectly fine.
Please help me as am unable to insert data in local language. Please guide me the steps how to configure the NLS_LANG and how to do it.
ht.html
=====
<form action="insert.php" method="post">
<p> Your ID : <input type="number" name="id" /></p>
<p> Your NAME: <input type="text" name="name" /></p>
<p><input type="submit" /></p>
insert.php
=======
<?php
# if ($REQUEST_METHOD=="POST")
// Before running, create the table:
// CREATE TABLE MYTABLE (mid NUMBER, myd VARCHAR2(20));
$dbuser = "bob";
$dbpass = "bob";
#$dbtsn = "orcl"
$dbconn = oci_connect($dbuser, $dbpass);
echo "The Oracle Database established";
$query = "INSERT INTO demo
     (id,name)
VALUES('".$_POST['id']."','".$_POST['name']."')";
$resultSet = oci_parse($dbconn,$query);
if (oci_execute($resultSet))
echo ("<BR> Record inserted");
else
echo ("<BR> error!!!!!!");
?>
showv.php
========
<?php
$conn = oci_connect('bob', 'bob', 'orcl');
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
$query = 'SELECT * FROM demo';
$stid = oci_parse($conn, $query);
if (!$stid) {
$e = oci_error($conn);
print htmlentities($e['message']);
exit;
$r = oci_execute($stid, OCI_DEFAULT);
if (!$r) {
$e = oci_error($stid);
echo htmlentities($e['message']);
exit;
print '<table border="2">';
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {
print '<tr>';
foreach ($row as $item) {
print '<td>'.($item?htmlentities($item):' ').'</td>';
print '</tr>';
print '</table>';
oci_close($conn);
?>
I am using RedHat Enterprise linux 4 update 1 and Oracle 10g.
Regards,
Pradyumna

Right... I found out how you can solve this, well not through the web interface... but oh well it is possible though...
the error I was getting was: ORA-01704:     string literal too long.
the keyword/phrase is "bind variables"... Did a little more searching and found this site:
http://www.akadia.com/services/ora_bind_variables.html
So basically you use bind variables to insert data which fills more than 4000 bytes...
Since the data I will be inserting will be inserted via Java/.NET application I found the section called "Bind Variables in VB, Java and other applications" the most interesting... During my testing and I had neglected to use PreparedStatements in Java, and according to the site, using PreparedStatement provided an easier solution as the API does most of the work for you. My solution was to create a small program which read the large amounts of data from a file then feed this to a PreparedStatement, setObject or setASCIIStream/setCharacterStream, then execute it.
Well I hope this helps other people who get the same error code.

Similar Messages

Maybe you are looking for