HungryMind Posted May 24, 2011 Share Posted May 24, 2011 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"]; Link to comment Share on other sites More sharing options...
2old2learn? Posted May 24, 2011 Share Posted May 24, 2011 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... Link to comment Share on other sites More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 What are you trying to get from this line:..$sql= "Select * From Orders"; <<<<< Looks incomplete... Still Getting Error If I'm Using Where Clause :SOn My Local PC It's Working Perfect... But Not On My FTP :S Link to comment Share on other sites More sharing options...
2old2learn? Posted May 24, 2011 Share Posted May 24, 2011 Still Getting Error If I'm Using Where Clause :SOn My Local PC It's Working Perfect... But Not On My FTP :SWhat 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 More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 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 No :S Link to comment Share on other sites More sharing options...
2old2learn? Posted May 24, 2011 Share Posted May 24, 2011 No :SShow us the form.php code to see line 17;thanks Link to comment Share on other sites More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 Show us the form.php code to see line 17;thanksMy 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 More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 Scientist!!! Where are you??? I Need Your Help. Please Come Here.. Link to comment Share on other sites More sharing options...
2old2learn? Posted May 24, 2011 Share Posted May 24, 2011 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 More sharing options...
thescientist Posted May 24, 2011 Share Posted May 24, 2011 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 More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 I have Used Too Many Times Table Names In Upper Or Lower Case. But First Time I've Got "Case" Error :SI Was Using "Orders" With Capital "O" :SThanks All.Resolved. Link to comment Share on other sites More sharing options...
HungryMind Posted May 24, 2011 Author Share Posted May 24, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.