danthemilk Posted July 16, 2009 Share Posted July 16, 2009 I am exporting my mySQL 5.0.41, UTF-8 database using the phpMyAdmin dialog on my localhost with these settings: type: SQL compatibility mode: NONE save as file: checked compression: NONE Then, I'm importing the file to a mySQL 5.0.45, UTF-8 database using phpMyAdmin on a remote server with the following settings: compatibility mode: NONE allow interrupt: checked The database appears to import without any problems. I can browse the tables with phpMyAdmin on the remote server, and edit them etc using the client. However, when I query the database with php I get an invalid resource. When I query the database for tables that existed prior to importing the new tables, I get a valid result. Does anybody know why I might be getting an invalid resource when my query result is a newly imported table? Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/ Share on other sites More sharing options...
rhodesa Posted July 16, 2009 Share Posted July 16, 2009 what is the error from mysql_error()? Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876647 Share on other sites More sharing options...
danthemilk Posted July 16, 2009 Author Share Posted July 16, 2009 mysql_error($result) returns: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876648 Share on other sites More sharing options...
danthemilk Posted July 16, 2009 Author Share Posted July 16, 2009 my query looks like this: $result = mysql_query("SELECT * FROM `newly_imported_table`"); Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876651 Share on other sites More sharing options...
rhodesa Posted July 16, 2009 Share Posted July 16, 2009 change it to: $result = mysql_query("SELECT * FROM `newly_imported_table`") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876658 Share on other sites More sharing options...
danthemilk Posted July 16, 2009 Author Share Posted July 16, 2009 it says Table 'database.newly_added_table' doesn't exist It clearly does exist, but that's a helpful hint. Thanks for your help so far! Any ideas why it wouldn't find the table? Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876663 Share on other sites More sharing options...
rhodesa Posted July 16, 2009 Share Posted July 16, 2009 this is a mysql database? make sure the user has the proper rights to access the table and you are connecting to the correct database Quote Link to comment https://forums.phpfreaks.com/topic/166236-export-import-issue/#findComment-876666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.