For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > March 2006 > PHP5 and Oci8 (forms)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP5 and Oci8 (forms)
Steff

2006-03-14, 6:56 pm

Hello everyone,

I've been wasting hours on this and I still don't know what's wrong with my
code.

I need help I am afraid.

Can anyone tell me what misses in this code to make the insertion
work?

The set up of php apache and oracle is ok. I can select stuff from the db.

I keep on getting this message:

Warning: oci_execute() [function.oci-execute]: ORA-00984:
a column name is not authorised here c:\pageWeb\test.php on line 13

========================================
=================
<html>

<head>

<title>test insert</title>

</head>

<body>

<p>test insert into db</p>

<p> </p>

<p> </p>

<form method="POST" action="test.php">

<p><input type="text" name="vegy_name" size="20"><input type="submit"
value="insert" name="B1"><input type="reset" value="reset" name="B2"></p>
</form>

<p> </p>

</body>

</html>

========================================
=================

<?php

$veg=vegy_name;


$c1=oci_connect("stephane","Stef1975",$bdtest05);

$query="insert into vegetables (name) values ($veg)";

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

oci_execute($stmt, OCI_DEFAULT);


oci_free_statement($stmt);

oci_close($c1);

?>

========================================
=================

thanks for looking!


Rich

2006-03-14, 6:56 pm

"Steff" <stephane.vollet@bluewin.ch> wrote in message
news:44172bde$1_2@news.bluewin.ch...
<snip>

Please don't cross-post, particularly when you already have your answer.

Oh, and if you missed the answer, you need single quotations around the
values of your insert query, ie:

$query = "insert into table (name) values ('$name')";

and not as you have:

$query = "insert into table (name) values ($name)";

Rich.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com