|
Posted by Marcin Dobrucki on 05/31/06 07:31
1) check that error reporting is enabled
2) check you don't have transactions on (you will need to commit by hand)
3) mysql_query can return a result. Capure it and analyse it
4) enable logging on the DB, and see what it gets. This often gives
a clue where the query breaks
And as much as PEAR::DB can kill performance, a query like that is
just begging to be automated via some kind of statement preparation.
You should also pay attention to escaping quotes and such, in your fields.
/marcin
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
>
> ------------------------------------------------------------------------
>
> Processed
> "; $link = mysql_connect("db377.perfora.net", "dbo165086404",
> "jxtJdnCJ") or die ('I cannot connect to the database because: ' .
> mysql_error()); echo "Connected
> "; mysql_select_db(db165086404) or die('Could not select database');
> echo "db Selected
> "; echo "Hi
> "; mysql_query("INSERT INTO 2006_eval (overall,
> overall_comments,difficult, difficulty_comments, homework,
> homework_comments, pace, pace_comments, grading_structure,
> grading_structure_comments, grading_fairness, grading_fairness_comments,
> tests, tests_comments, labs, labs_comments, questions,
> questions_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', '$grading_fairness',
> $grading_fairness_comments', '$tests', '$tests_comments', '$labs',
> '$labs_comments', '$questions', '$questions_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')"); ?> Inserted
[Back to original message]
|