aleks5 Posted February 8, 2010 Share Posted February 8, 2010 HI all, my provider switched to MySQL v 5.1.42 (previous verson was 4.x.x) and my simple quert doesn't work anymore. here it is: $result = mysql_query("SELECT id AS page_id, page_$lang AS headline, template_id FROM pages WHERE id='$page_id'"); $myrow = mysql_fetch_array($result); here's the error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource Connection to database works, and variables are also visible. I get same result if i change variables into values. I've contacted supper, and they say that code is not compatible with MySQL5, but they don't want to say how should i change it. I've tried to find solution in the manaul, but to me, it seems that code is ok. Please help Quote Link to comment https://forums.phpfreaks.com/topic/191324-my-provider-changed-mysql-version-and-query-doesnt-work-anymore/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 8, 2010 Share Posted February 8, 2010 Find out why the query is failing. Add an echo mysql_error(); statement on a line immediately after the mysql_query() line. Quote Link to comment https://forums.phpfreaks.com/topic/191324-my-provider-changed-mysql-version-and-query-doesnt-work-anymore/#findComment-1008746 Share on other sites More sharing options...
aleks5 Posted February 8, 2010 Author Share Posted February 8, 2010 "Table 'borokred.pages' doesn't exist" well.. of course it doesn't, but why is it trying to get data from that table, when, in query i have ".. FROM pages..." Quote Link to comment https://forums.phpfreaks.com/topic/191324-my-provider-changed-mysql-version-and-query-doesnt-work-anymore/#findComment-1008757 Share on other sites More sharing options...
PFMaBiSmAd Posted February 8, 2010 Share Posted February 8, 2010 borokred is the database name. Do you have a database with that name that has a table pages in it? Is the capitalization correct for both the database and the table name (in case your web host did something to cause the letter-case to become significant or different from what it previously was.) Quote Link to comment https://forums.phpfreaks.com/topic/191324-my-provider-changed-mysql-version-and-query-doesnt-work-anymore/#findComment-1008760 Share on other sites More sharing options...
aleks5 Posted February 8, 2010 Author Share Posted February 8, 2010 well.. who would thought of that... provider completly erased all tables from DB, no wonder that i can't gfet any result. Anyway, thank you for your effort. Quote Link to comment https://forums.phpfreaks.com/topic/191324-my-provider-changed-mysql-version-and-query-doesnt-work-anymore/#findComment-1008780 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.