Posted by khansahib, 12-23-2009, 10:00 AM | Hello,
I am getting error on one of my website's page, its connected to database, i have tried checking database but its Ok, i also restored the old db but still the same issue.
here is what i am getting.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/softwares/downfile.php on line 50
here is what that downfile.php have on line 50
i am on cpanel/whm dedicated server, using
mysql (5.0.85-community)
|
Posted by prashant1979, 12-23-2009, 10:47 AM | what does the line 50 in the code contain? Maybe that will help to find the cause.
|
Posted by ramsh, 12-23-2009, 11:03 AM | Hello,
Please try to restart the mysql service .Seems its a warning error generated from your scripts . Please check your scripts also
|
Posted by khansahib, 12-23-2009, 11:04 AM | if you can re read my post i have mentioned that line,
here i will post again
|
Posted by bear, 12-23-2009, 11:06 AM | What's the value for "$res"? It would be helpful to include several lines above and below that one that was reported.
|
Posted by khansahib, 12-23-2009, 11:07 AM | from line 42 to 58
|
Posted by WebHostingNeeds, 12-23-2009, 11:33 AM | Replace
With
Where does $tablename comes from ?
|
Posted by khansahib, 12-23-2009, 11:37 AM | now getting the issue
Query failed: Table 'emobilez_ads.filename' doesn't exist
where emobilez_ads is the database of some other script which is included in header.php. and where filename is the table of the database on which the issue is coming.
here is what included at top of downfile.php
Last edited by khansahib; 12-23-2009 at 11:42 AM.
|
Posted by BTCentral - Ben, 12-23-2009, 11:45 AM | So unless I misunderstood you want it just to look at the table "filename"?
If so put:
In the line above:
Last edited by BTCentral - Ben; 12-23-2009 at 11:49 AM.
|
Posted by khansahib, 12-23-2009, 11:50 AM | now its coming up with the issue
Query failed: Table 'emobilez_ads.filename' doesn't exist
where emobilez_ads is the database of some other script which is included in header.php don't know why its showing that database name here, where is the database of the concerned script is named as emobilez_andro
|
Posted by BTCentral - Ben, 12-23-2009, 11:52 AM | Read the post above, I edited my post a few times.
|
Posted by khansahib, 12-23-2009, 11:55 AM | sorry where to put
|
Posted by BTCentral - Ben, 12-23-2009, 11:57 AM | Try this instead, you are currently connected to the wrong database:
Last edited by BTCentral - Ben; 12-23-2009 at 12:02 PM.
|
Posted by khansahib, 12-23-2009, 12:07 PM | Access denied for user 'emobilez_ads'@'localhost' to database 'emobilez_andro'
username for both databases are same with same user name i mean that of database.
e.g. database - emobilez_ads is database and its username is also emobilez_ads
and that of emobilez_andro is database and username is emobilez_andro
Last edited by khansahib; 12-23-2009 at 12:10 PM.
|
Posted by BTCentral - Ben, 12-23-2009, 12:13 PM | Then you need to put this line above mysql_select_db("emobilez_andro") or die(mysql_error());
Make sure you change yourpasswordgoeshere to your actual password.
|
Posted by madaboutlinux, 12-23-2009, 12:15 PM | It means the user 'emobilez_ads' don't have enough privileges to access the database 'emobilez_andro'. You can either assign the user to the database from
OR
grant the privileges from the mysql prompt. Go to mysql prompt and do the following:
where, password is the actual password of the database user 'emobilez_ads'.
|
Posted by khansahib, 12-23-2009, 12:15 PM | it is already mentioned in sqlloing.php file which is include in top of downfile.php
here is what that sqllogin.php file have
|
Posted by BTCentral - Ben, 12-23-2009, 12:17 PM | Well something obviously is not working and without access to the source code there's no way to tell you what is wrong.
I'm going to leave this post be now, you've already been told what you need to do to fix the error.
Last edited by BTCentral - Ben; 12-23-2009 at 12:20 PM.
|
Posted by khansahib, 12-23-2009, 12:23 PM | done the trick.
Thanks.
|
|
Add to Favourites
Print this Article |