Re: PHP and Oracle
| From: | Philippe Saladin | Date: | Thu, 13 Dec 2001 09:19:48 +0000 |
| Subject: | Re: PHP and Oracle | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14983@lists.php.net to get a copy of this message | ||
Hi Georgina,
If projectID or moduleID is a number and not a varchar, you would remove the
' enclosing the values.
WHERE projectID=$projectID vs WHERE projectID='$projectID'
Regards,
Philippe
"Georgina Elaine Bailey" <geb97@aber.ac.uk> a écrit dans le message news:
000801c18272$8189aa10$4e167c90@psv.aber.ac.uk...
Can anybody help me! I've been getting a error message like this for the
last few days.
Warning: OCIStmtExecute: ORA-01722: invalid number on line 49
Array
Every time I try to enter a project using a HTML form
Line 49 in apparently the line that says:
$result = OCIExecute(ins_statement);
Below is the code I am trying to use:
//insert relevant values into the project table
$insert = "insert into PROJECT values ('$projectID', '$moduleID', $keyID,
'$title', '$originator', '$softwareHardware',
'$specialSkills', '$status',
'$externalAgreement', '$background', '$tasks', '$steps',
'$references')";
//formulate the query
$query = "select projectID, moduleID, title, originator,
softwareHardware, specialSkills, status, externalAgreement,
background, tasks, steps, references from PROJECT WHERE
projectID='$projectID'";
//parse the two statements
$ins_statement = OCIParse ($connection, $insert);
$qry_statement = OCIParse ($connection, $query);
//execute the first insert statement and print error message if
there is an error
$result = OCIExecute($ins_statement);
if (!$result)
{
echo OCIError($ins_statement)."<p>";
exit;
}
//execute the query statement
OCIExecute($qry_statement);
//retrieve the results of the query statement and present them
in the following way
while (ocifetch($qry_statement))
{ etc.etc.