hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a database. the form submits some data to one table, and other data to another table. my problem is that the data only gets added to the first table, but data doesnt enter correnctly into the other one.
Code: <?PHP
$questionno = $_POST['questionno'];
$question = $_POST['question'];
$quizref = $_POST['quizref'];
$answerno = $_POST['answerno'];
$answer = $_POST['answer'];
$answervalue = $_POST['answervalue'];
pg_connect("host=database.*******.uk
port=5432 dbname=***** user=***** password=******");
?>
<html>
<head>
<title>Add </title>
</head>
<body>
<?php
$query="INSERT INTO questions (questionno, question, quizref)VALUES ('".$questionno."', '".$question."', '".$quizref."')";
pg_query($query) or die ('Error adding new question');
echo "The question has been added to the quiz";
$queryanswers="INSERT INTO answers (answerno, answer, answervalue, questionno, quizref)VALUES ('".$answerno."', '".$answer."','".$answervalue."', '".$questionno."', '".$quizref."')";
pg_query($queryanswers) or die ('Error adding new answers');
echo "The answers has been added to the question";
?>
<form method="post" action="">
quizref: <br/>
<input type="text" name ="quizref" size="5" /><br/>
Question Number: <br/>
<input type="text" name="questionno" size="5" /><br/>
Question: <br/>
<input type="text" name="question" size="60" /><br/>
Answers<br/><br/>
Answer number:<br/>
<input type="text" name ="answerno" size="5" /><br/>
Answer<br/>
<input type="text" name ="answer" size="60" /><br/>
Answer value<br/>
<input type="text" name ="answervalue" size="5" /><br/>
<br/><br/>
Answer number:<br/>
<input type="text" name ="answerno" size="5" /><br/>
Answer<br/>
<input type="text" name ="answer" size="60" /><br/>
Answer value<br/>
<input type="text" name ="answervalue" size="5" /><br/>
<br/><br/>
Answer number:<br/>
<input type="text" name ="answerno" size="5" /><br/>
Answer<br/>
<input type="text" name ="answer" size="60" /><br/>
Answer value<br/>
<input type="text" name ="answervalue" size="5" /><br/>
<br/><br/>
Answer number:<br/>
<input type="text" name ="answerno" size="5" /><br/>
Answer<br/>
<input type="text" name ="answer" size="60" /><br/>
Answer value<br/>
<input type="text" name ="answervalue" size="5" /><br/>
<br/><br/>
<input type="submit" value="Send and Add another Add Questions" />
<a href="addfinish.php"><input type="submit" value="Add and finish" /></a>
</form>
</body>
</html>
Any help would be great.
thanks
Linkage between two scripts
Okay say I have this for a link in a script:Code: <li><a href="#" onclick="ajaxpage('bio', 'content'); return
PHP FTP connect doesn't work with correct login
Hi!i am working on this test code:Quote<?php $ftp_server = "ftp.*******.it";$ftp_user = "weburl@*******.it";$ftp_pass = "CENSORED";// set up a
How to add advertisment on top of videos
Hello,I was told that i should find the answer for this problem in this forums.I searched a lot but i couldnt find the solution .What i need to do is to add ads on top of the videos i have
Pass sql into pl/sql and create RMAN duplicate script.
Hi,
compile php5 with DOM
Hi,I can't manage to compile php 5.3.0 from source on Windows to include DOM,in spite of the documentation saying that DOM is built into PHP5.I'm compiling php 5.3.0 using the following minimalistic
very easy question about SQL info
Hello,I think that I have a very easy question.I know how to create a form using php SQL and display the info.BUT the only problem that I have is:In my website, I am linking all the pages with the
Captcha problem users just refresh and it will let them auto submit again
Users will just re submit and not have to enter the new captcha.. ? Lol but if i refresh the page, the captcha auto makes a new1 so u cant submit.But if u enter captcha code alrdy, then submit form
Multiple Options for a Single Page
For this example I want to use the Handlers option which is under Fed Admin and all the related coding to the handlers option is found on the handlers.php page which includes a list of handlers with a
New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understand simple arrays, associative arrays, and multidimensional arrays also. The book I am reading
SOAP Issue
Hi,I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.Thanks