我是菜鸟,先说下。。 我认为应该标准的用字符串连接。 我觉得usr='$nm' and passwd1='$psw'";这样$nm、$psw会被当作字符串处理,而不会引用变量 我上面的也是错的,应该是下面的: usr='".$nm."' and passwd1='".$psw."'"; 还有我觉得你里面的while循环不可难道不行吗?
badwish(魔心):其实我非常不想要里面的while循环,但是如果不要,我不知道该怎么取出查询结果中某列的值,其实本来就不该要里面的while循环,因为记录是只有一条的usr='$nm' and passwd1='$psw'";这样$nm、$psw没有被当作字符串处理啊我刚刚接触PHP,很多语法和函数都不知道,超级菜
你那个sql语句没什么大问题,可以正常赋值的。======================Oracle 什么版本的?官方解释 http://download-east.oracle.com/docs/cd/A58617_01/server.804/a58312/newch221.htmORA-01002: fetch out of sequence Cause: In a host language program, a FETCH call was issued out of sequence. A successful parse-and-execute call must be issued before a fetch. This can occur if an attempt was made to FETCH from an active set after all records have been fetched. This may be caused by fetching from a SELECT FOR UPDATE cursor after a commit. A PL/SQL cursor loop implicitly does fetches and may also cause this error. Action: Parse and execute a SQL statement before attempting to fetch the data. 解决方案 http://blog.csdn.net/annicybc/archive/2006/05/25/755379.aspx 在查询前,注意设置Connection的一个属性: conn.setAutoCommit(false);如果缺少这一步,可能导致fetch out of sequence等异常
fredyj(醉爱酸奶):我在查询前加的conn.setAutoCommit(false);可是弹出:Call to undefined function: setautocommit() 怎么回事呢?
改过之后不行,正确的用户名和密码都登录不了了
如果想引用在函数内部用这个符号
OciFetchInto ($result, $arr_s_QZJX_AZSQD)
我认为应该标准的用字符串连接。
我觉得usr='$nm' and passwd1='$psw'";这样$nm、$psw会被当作字符串处理,而不会引用变量
我上面的也是错的,应该是下面的:
usr='".$nm."' and passwd1='".$psw."'";
还有我觉得你里面的while循环不可难道不行吗?
http://download-east.oracle.com/docs/cd/A58617_01/server.804/a58312/newch221.htmORA-01002: fetch out of sequence
Cause: In a host language program, a FETCH call was issued out of sequence. A successful parse-and-execute call must be issued before a fetch. This can occur if an attempt was made to FETCH from an active set after all records have been fetched. This may be caused by fetching from a SELECT FOR UPDATE cursor after a commit. A PL/SQL cursor loop implicitly does fetches and may also cause this error.
Action: Parse and execute a SQL statement before attempting to fetch the data. 解决方案
http://blog.csdn.net/annicybc/archive/2006/05/25/755379.aspx
在查询前,注意设置Connection的一个属性:
conn.setAutoCommit(false);如果缺少这一步,可能导致fetch out of sequence等异常