i3lack Posted July 12, 2008 Share Posted July 12, 2008 I have my own site, and all files worked on the free host but i upgraded to paid so now i get errors can someone please help me!!! Warning: Division by zero in /home/grandma/public_html/index.php on line 4 Warning: mysql_query() [function.mysql-query]: Access denied for user 'grandma'@'localhost' (using password: NO) in /home/grandma/public_html/index.php on line 16 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/grandma/public_html/index.php on line 16 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/grandma/public_html/index.php on line 19 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/grandma/public_html/index.php on line 20 Any HELP PLEASE PLEASE, i have had so called expert scripters tell me the cant help =( i really need this to work. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 12, 2008 Share Posted July 12, 2008 The first error means that your code performed a division by zero. Either a value is not being set or it is being set to a zero value or the error always was occurring but the error_reporting level or the display_errors setting prevented the error from being displayed. The next two errors mean that there was no connection to a database server when the mysql_query() was executed and the mysql_query() attempted to create a connection using default values. This indicates that you mysql_connect() is failing but has not error checking logic for it and the code blindly continues execution. The last two errors are because the mysql_query() failed and your code has no error checking logic in it so that it blindly continued execution and attempted to access a non-existent result resource. To get any specific help with these you would need to post the file (xxxx out any sensitive information such as database username and password.) Quote Link to comment Share on other sites More sharing options...
i3lack Posted July 12, 2008 Author Share Posted July 12, 2008 Here it is, if someone wants to help please email me please i really want to get this site up! lavalley2010@live.com <?php $mysql_server = "localhost"; $mysql_user = "xxxxxx"; $mysql_password = "xxxxxxxxxxxxxxx"; $mysql_database = "grandma_grandmafia"; $timeoutseconds = 300000; $connection = mysql_connect("$mysql_server","$mysql_user","$mysql_password") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../offline.php\">"); $db = mysql_select_db("$mysql_database") or die ("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=../index.php\">"); ?> Quote Link to comment Share on other sites More sharing options...
next Posted July 12, 2008 Share Posted July 12, 2008 i think it's to late with masking sensitive information . If you will read those errors you'll understand that your user has no password set and apparently your $mysql_password variable has some value assigned to it, therefore you are failing to connect. Correct this and the rest should work just fine. Cmon, you should know that it's against math rules to divide by 0, you need to fix you expression. Quote Link to comment 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.