Jump to content

Warning: mysql_fetch_array():


HungryMind
 Share

Recommended Posts

Hi...Unexpected Getting This Error When I'm Running This Code On My FTP Server, But On My Local PC, It's Working Perfect :SWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mypath/form.php on line 17

$localhost	=	"localhost";$username =	"";$password	=	"";$database	=	"mydb";$conn = mysql_connect($localhost,$username,$password);if(!$conn){	print "Unable to Connect DB";}if(!mysql_select_db($database, $conn)){	print "Unable to select DB";}$Query = "Select * From Orders";$Result = mysql_query($Query, $conn);$Row = mysql_fetch_array($Result); // ERROR Is HERE ON LINE 17$Id = $Row["Id"];

Edited by HungryMind
Link to comment
Share on other sites

Hi...Unexpected Getting This Error :SWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mypath/form.php on line 17
$localhost	=	"localhost";$username =	"";$password	=	"";$database	=	"mydb";$conn = mysql_connect($localhost,$username,$password);if(!$conn){	print "Unable to Connect DB";}if(!mysql_select_db($database, $conn)){	print "Unable to select DB";}$Query = "Select * From Orders";$Result = mysql_query($Query, $conn);$Row = mysql_fetch_array($Result); // ERROR Is HERE$Id = $Row["Id"];

What are you trying to get from this line:..
$sql= "Select * From Orders";  <<<<< Looks incomplete...

Edited by 2old2learn?
Link to comment
Share on other sites

Still Getting Error If I'm Using Where Clause :SOn My Local PC It's Working Perfect... But Not On My FTP :S
What field's are you calling for in the $sql statement;
$sql= "Select * From Orders";  <<<<< Looks incomplete...

here is an example:

SELECT column_name(s)  FROM table_name

Link to comment
Share on other sites

Show us the form.php code to see line 17;thanks
My Friend This Is Complete Code :)
$localhost	=	"localhost";$username =	"";$password	=	"";$database	=	"mydb";$conn = mysql_connect($localhost,$username,$password);if(!$conn){	print "Unable to Connect DB";}if(!mysql_select_db($database, $conn)){	print "Unable to select DB";}$Query = "Select * From Orders";$Result = mysql_query($Query, $conn);$Row = mysql_fetch_array($Result); // ERROR Is HERE$Id = $Row["Id"];

Link to comment
Share on other sites

Scientist!!! Where are you??? I Need Your Help. Please Come Here..
Then whats this all about..from your first post????
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mypath/form.php on line 17
Link to comment
Share on other sites

if $Result is throwing an error because it is not a valid result resource, then something is wrong with the previous line

$Result = mysql_query($Query, $conn);

so I'm thinking there is something wrong with your query? Are you sure your login credentials are correct and the the table and database you are selecting are correct?

Link to comment
Share on other sites

if $Result is throwing an error because it is not a valid result resource, then something is wrong with the previous line
$Result = mysql_query($Query, $conn);

so I'm thinking there is something wrong with your query? Are you sure your login credentials are correct and the the table and database you are selecting are correct?

My Friend That Was Unexpected Error For Me :SThat Was Letter "CASE" Issue.Even I've Used Table Names Too Many Times With Upper & Lower Case and That Was Work.But Not This Time :SThanks For Help :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...