469,925 Members | 1,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

supplied argument is not a valid MySQL result resource

hi i get the following errors returning me folloing post to data base
Expand|Select|Wrap|Line Numbers
  1. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\chris1\My Documents\xampp\htdocs\elp\modify_information.php on line 89
  3. Warning: Cannot modify header information - headers already sent by (output started at C:\Documents and Settings\chris1\My Documents\xampp\htdocs\elp\modify_information.php:89) in C:\Documents and Settings\chris1\My Documents\xampp\htdocs\elp\modify_information.php on line 90
using xammp mysql apache

code starts at line 84

Expand|Select|Wrap|Line Numbers
  1.   $RSStudent=$RSStudent_query=@mysql_query(("update OCStudents set StudentName = '"
  2.     .$_POST["Name"]."', StudentEmailAddress = '"
  3.     .$_POST["EmailAddress"]."', StudentPassword = '"
  4.     .$_POST["Password"]."' where StudentID = "
  5.     .$_SESSION['StudentID']),$conn);
  6. $RSStudent=mysql_fetch_array($RSStudent_query);
  7. ;header("Location: "."student_menu.php");}
  8. ?>
lines affected are in bold...lines 89 and 90
any ideas how to solve this
thanks in advance chris
Sep 12 '07 #1
3 1090
4,258 Expert 4TB
Welcome to TSDN.
In future enclose your code within code tags. See the Posting Guidelines at the top of this forum.

First statement (84) should be
[php]$RSStudent_query=@mysql_query(("update OCStudents set StudentName = '"
Sep 12 '07 #2
code green
1,726 Expert 1GB
The query is an UPDATE.
A SELECT returns rows not an UPDATE.
And PLEASE adopt accepted practice for variable names. Ugh!
Sep 12 '07 #3
1,044 Expert 1GB
Be sure that you know what your queries are doing before trying to do things with them. mysql_fetch_* functions are for SELECT statements, as they are the only queries that return a result set.
Sep 12 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.