Jump to content

Oracle + PHP form


Recommended Posts

Hi.

 

I can't figure out how to send things to the database with PHP + Oracle.  Never had a problem with MySQL but this switch to Oracle is just annoying (forced, no choice). 

 

I have to use odbc commands too.

 

If anyone can code me just a 1 or 2 question form example that submits to the database that would be great!

Thanks!

Link to comment
Share on other sites

<?php
$connect = odbc_connect("oratest", "user",
"pass");

$query1 = "select * FROM NOMINATIONS";

$result = odbc_exec($connect, $query1);

odbc_result_all($result);
?>



<form action="index.php" method="post">
<input name="auto" type="text" id="auto" maxlength="14">
<Br />
<input name="nominee" type="text" id="nominee" maxlength="14">
<Br />
<input name="position" type="text" id="position" maxlength="14">
<Br />
<input name="department" type="text" id="department" maxlength="14">
<Br />
<input name="group" type="text" id="group" maxlength="14">
<Br />
<input name="nominator" type="text" id="nominator" maxlength="14">
<Br />
<input name="nominator_phone" type="text" id="nominator_phone" maxlength="14">
<Br />
<input name="nominator_email" type="text" id="nominator_email" maxlength="14">
<Br />
<input name="question1" type="text" id="question1" maxlength="14">
<Br />
<input name="question2" type="text" id="question2" maxlength="14">
<Br />
<input name="question3" type="text" id="question3" maxlength="14">
<Br />
<input name="question4" type="text" id="question4" maxlength="14">
<Br />
<input name="question5" type="text" id="question5" maxlength="14">
<Br />
<input name="" type="submit" value="Submit" />
</form>

<?php
$auto = ($_POST['auto']);
$nominee = ($_POST['nominee']);
$position = ($_POST['position']);
$department = ($_POST['department']);
$group = ($_POST['group']);
$nominator = ($_POST['nominator']);
$nominator_phone = ($_POST['nominator_phone']);
$nominator_email = ($_POST['nominator_email']);
$question1 = ($_POST['question1']);
$question2 = ($_POST['question2']);
$question3 = ($_POST['question3']);
$question4 = ($_POST['question4']);
$question5 = ($_POST['question5']);

odbc_execute("insert into NOMINATIONS SET nominee = '$nominee', auto = '$auto', position = '$position', department = '$department', group = '$group', nominator = '$nominator', nominator_phone = '$nominator_phone', nominator_email = '$nominator_email', question1 = '$question1', question2 = '$question2', question3 = '$question3', question4 = '$question4', question5 = '$question5'");


?>

 

And honestly, i dont think i HAVE to use odbc_, i think the guy just said it was easier or something? i already officially hate oracle, lol.  Any help would be great. thanks.

Link to comment
Share on other sites

what is the error u r getting?

 

okay man sorry but if anyone else can help that would be great.  you've told me to try and to paste the code and all and you haven't offered any form of help at all.  I mean if you really know how to do what im trying to do and could help you could have looked at the code and seen what i'm doing wrong by now. sorry, not trying to be a jerk, just wanted some help and getting more aggravated then Oracle is already making me.

Link to comment
Share on other sites

  • 4 weeks later...

what is the error u r getting?

 

okay man sorry but if anyone else can help that would be great.  you've told me to try and to paste the code and all and you haven't offered any form of help at all.  I mean if you really know how to do what im trying to do and could help you could have looked at the code and seen what i'm doing wrong by now. sorry, not trying to be a jerk, just wanted some help and getting more aggravated then Oracle is already making me.

 

Dude what is wrong with you? The guy is trying to help as best as he can! He gave you some suggestions and you choose not to follow them. No biggy.

 

He looked at your code and he might not have found the error. So relax.

 

Oh, and google is your friend. Don't expect him or me to do your homework for you!  :D

Link to comment
Share on other sites

  • 3 weeks later...

 

Al fin que encuentro ayuda !!!!!!1

 

Saben ya tengo listo para usar el oracle con el php, tengo el formulario de mostrar registros pero me hacen falta los siguientes formularios >

 

1. insertar

2. eliminar

3. buscar

4. modificar

 

Si alguein sabe como va el codigo en cada formulario que sea amables en poner el codigo ....... ;)

//Me salen errores de codigo es por eso que les pido ayuda, les estare muy agradecido.  please !!!!!!!!

 

 

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.