帮助php到MySql ... [英] Help with php to MySql...

查看:68
本文介绍了帮助php到MySql ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好 -


我正在尝试使用php写入一个MySql数据库,而且我好像是在敲打墙壁的时间。

。 >

我附上我的php文件以防有人可以查看它。当我运行

它时,我没有收到任何错误消息,所有的回声都通过但是

没有写入我的数据库。我想我错过了什么

愚蠢。任何帮助将不胜感激。


谢谢,

彼得

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

推荐答案



1)检查是否启用了错误报告

2)检查你没有交易(你需要手工提交)

3)mysql_query可以返回结果。捕获并分析它

4)启用数据库登录,看看它得到了什么。这通常会给查询中断的地方提供

a线索


尽管PEAR :: DB可以杀死性能,但像这样的查询是

只是通过某种陈述准备来乞求自动化。

你还应该注意在你的领域中逃避报价等。


/ marcin


Peschtra写道:

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:
你好 -

我正在尝试使用php写一个MySql数据库,而我好像是撞墙了。

我附上我的php文件以防万一有人可以看一下。当我运行
它时,我没有得到任何错误消息,所有的回声都通过但是
没有任何内容写入我的数据库。我想我错过了一些愚蠢的东西。任何帮助将不胜感激。

谢谢,
彼得

--------------------- -------------------------------------------------- -

已处理
&;;;
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或死(''我无法连接到数据库因为:''。
mysql_error()); echoConnected
; mysql_select_db(db165086404)或死(''无法选择数据库');
echo" db Selected
" ;;回声嗨
; mysql_query(" INSERT INTO 2006_eval(整体,
overall_comments,难度,难度评论,作业,
homework_comments,pace,pace_comments,grading_structure,
grading_structure_comments,grading_fairness,grading_fairness_comments,
测试, 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(''
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 (''


整体'',''


这篇关于帮助php到MySql ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆