Re: Help with php to MySql...



take a close look at $grading_fairness_comments
Peschtra wrote:
Hello --

I am trying to write to a a MySql database using php, and I seem to be
hitting a wall.

I am attaching my php file in case someone can look at it. When I run
it, I don't get any error messages and all my echoes come through but
nothing is written to my database. I think I am missing something
stupid. Any help would be appreciated.

Thanks,
Peter

--------------030200090501090308020103
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
filename="eval.php"
X-Google-AttachSize: 3113

<html>
<body>

<?php

$overall =3D $_POST["overall"];
echo $overall;
$overall_comments =3D $_POST["overall_comments"];
echo $overall_comments;
$difficulty =3D $_POST["difficulty"];
$difficulty_comments =3D $_POST["difficulty_comments"];
$homework =3D $_POST["homework"];
$homework_comments =3D $_POST["homework_comments"];
$pace =3D $_POST["pace"];
$pace_comments =3D $_POST["pace_comments"];
$grading_structure =3D $_POST["grading_structure"];
$grading_structure_comments =3D $_POST["grading_structure_comments"];
$grading_fairness =3D $_POST["grading_fairness"];
$grading_fairness_comments =3D $_POST["grading_fairness_comments"];
$tests =3D $_POSTS["tests"];
$tests_comments =3D $_POST["tests_comments"];
$labs =3D $_POST["labs"];
$labs_comments =3D $_POST["labs_comments"];
$questions =3D $_POST["questions"];
$questions_comments =3D $_POST["questions_comments"];
$approach =3D $_POST["approach"];
$approach_comments =3D $_POST["approach_comments"];
$fav_topic =3D $_POST["fav_topic"];
$fav_act =3D $_POST["fav_act"];
$least_fav_topic =3D $_POST["least_fav_topic"];
$least_fav_act =3D $_POST["least_fav_act"];
$extra_topic =3D $_POST["extra_topic"];
$tests_prepared =3D $_POST["tests_prepared"];
$didnt_get =3D $_POST["didnt_get"];
$change =3D $_POST["change"];
$again =3D $_POST["again"];
$again_comments =3D $_POST["again_comments"];
$general_comments =3D $_POST["general_comments"];
$name =3D $_POST["name"];
$ip =3D GetHostByName($REMOTE_ADDR);
echo $ip;
$year =3D $_POST["year"];
echo $year;
$math =3D $_POST["math"];
$science =3D $_POST["science"];
$grade =3D $_POST["grade"];
echo $grade;

echo "<br />Processed <br />";

$link =3D mysql_connect("db377.perfora.net", "dbo165086404", "jxtJdnCJ") =
or die ('I cannot connect to the database because: ' . mysql_error());

echo "Connected <br />";

mysql_select_db(db165086404) or die('Could not select database');

echo "db Selected <br />";

echo "Hi <br />";

mysql_query("INSERT INTO 2006_eval (overall, overall_comments,difficult, =
difficulty_comments, homework, homework_comments, pace, pace_comments, gr=
ading_structure, grading_structure_comments, grading_fairness, grading_fa=
irness_comments, tests, tests_comments, labs, labs_comments, questions, q=
uestions_comments, approach, approach_comments, fav_topic, fav_act, least=
_fav_topic, least_fav_act, extra_topic, tests_prepared, didnt_get, change=
, again, again_comments, general_comments, name, ip, year, math, science,=
grade, number) VALUES ('$overall', '$overall_comments', '$difficulty', '=
$difficulty_comments', '$homework', '$homework_comments', '$pace', '$pace=
_comments', '$grading_structure', '$grading_structure_comments', '$gradin=
g_fairness', $grading_fairness_comments', '$tests', '$tests_comments', '$=
labs', '$labs_comments', '$questions', '$questions_comments', '$approach'=
, '$approach_comments', '$fav_topic', '$fav_act', '$least_fav_topic', '$l=
east_fav_act', '$extra_topic', '$tests_prepared', '$didnt_get', '$change'=
, '$again', '$again_comments', '$general_comments', '$name', '$ip', '$yea=
r', '$math', '$science', '$grade')");
?>

Inserted
</body>
</html>

--------------030200090501090308020103--

.



Relevant Pages

  • Re: php in database entry...
    ... Since i am the onlyone populating the database, it wont be such a great ... in my main php file i retrieve the field and i echo it (echo ... But you are much better off creating a proper design for both your code ...
    (comp.lang.php)
  • Re: ********Caution Newbie********editing and deleting from mysql database
    ... echo $movie_name; ... delete record's from database -- User chooses which record to update ... Yes Jerry, I agree the coder should know what they are dealing with, but since I was not the coder and was going off the code sent I stated that the int function would only work if the id 'was' an int. ...
    (comp.lang.php)
  • Re: php in database entry...
    ... in my main php file i retrieve the field and i echo it (echo ... now i need in this field to have a php script to retrieve some info from another field, so lets say that the content ... it's a very bad idea to keep PHP code in a database. ...
    (comp.lang.php)
  • Re: ********Caution Newbie********editing and deleting from mysql database
    ... echo $movie_name; ... delete record's from database -- User chooses which record to update ... Secondly where are you getting the $movie_id value from for your query? ...
    (comp.lang.php)
  • Re: [PHP] Sometime the code works and sometimes doesnt
    ... password in my mailbox once but not always. ... // connect and select the database ... echo "Your Password Has Been Sent To Your Email Address."; ... Sent from the PHP - General mailing list archive at Nabble.com. ...
    (php.general)