By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,187 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,187 IT Pros & Developers. It's quick & easy.

supplied argument is not a valid MySQL result resource

P: 1
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
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 4,258
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
Expert 100+
P: 1,726
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

Expert 100+
P: 1,044
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.

Browse more PHP Questions on Bytes