Jump to content

Php, Mysql HELP


i3lack

Recommended Posts

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.

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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\">");


?>

 

Link to comment
Share on other sites

i think it's to late with masking sensitive information  ;D .

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.