Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mysql query and fetch_array errors

Featured Replies

Getting these errors on my home page, still very new to coding and php and I don't really have the foggiest idea of how to handle the situation, any kind of help would be greatly appreciated.

 

 

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'richard'@'localhost' (using password: NO) in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/richard/public_html/include/config.php on line 9

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'richard'@'localhost' (using password: NO) in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/richard/public_html/include/config.php on line 9

Getting these errors on my home page, still very new to coding and php and I don't really have the foggiest idea of how to handle the situation, any kind of help would be greatly appreciated.

 

 

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'richard'@'localhost' (using password: NO) in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/richard/public_html/include/config.php on line 9

 

Warning: mysql_query() [function.mysql-query]: Access denied for user 'richard'@'localhost' (using password: NO) in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/richard/public_html/include/config.php on line 8

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/richard/public_html/include/config.php on line 9

 

forget the other errors there the result of the first error and the first one means ur database connect info is incorrect paste ur code

Quite clearly states the user "richard" doesn't have a password supplied with it. You need to correct the username/password

  • Author

Quite clearly states the user "richard" doesn't have a password supplied with it. You need to correct the username/password

 

Wow thanks for the fast replies.

 

Still really new to all this. How would one go about correcting the username and password? where would those be and how can I change them?

  • Author

forget the other errors there the result of the first error and the first one means ur database connect info is incorrect paste ur code

 

 

I have no idea how to resolve this issue, how does one correct the database connection info, and what code exactly should I be pasting as per your request.

 

 

My company fired our programmer, and threw me into this mess. I usually just edit the films and work with creating Dvd's, but considering my boss thinks that "good with computers" means its now my job to handle any and all problems that involve the website or computer. So if my questions to your comments seem ignorant, its because I really am very new.

Open the config.php file with a text editor and there should be connection details at the top. If you're still struggling post the PHP code here.

  • Author

Open the config.php file with a text editor and there should be connection details at the top. If you're still struggling post the PHP code here.

 

 

this is the config.php code

 

<?php

include("init.php");

//include("base.php");

@mysql_connect($server,$user,$pwd);

@mysql_select_db($db);

@session_start();

$uid = $_SESSION['uname'];

$q_meal_info = mysql_query("select primary_goal,height_feet,height_inc,weight,menu_type,activity_level from customer where email='".$uid."'");

$r_meal_info = mysql_fetch_array($q_meal_info);

$_SESSION['goal'] = $goal1 = $r_meal_info['primary_goal'];

$_SESSION['weight'] = $weight1 = $r_meal_info['weight'];

$_SESSION['feet'] = $feet1 = $r_meal_info['height_feet'];

$_SESSION['inch'] = $inch1 = $r_meal_info['height_inc'];

$_SESSION['aclev'] = $aclev1 = $r_meal_info['activity_level'];

?>

this is the config.php code

 

<?php

include("init.php");

//include("base.php");

@mysql_connect($server,$user,$pwd);

@mysql_select_db($db);

@session_start();

$uid = $_SESSION['uname'];

$q_meal_info = mysql_query("select primary_goal,height_feet,height_inc,weight,menu_type,activity_level from customer where email='".$uid."'");

$r_meal_info = mysql_fetch_array($q_meal_info);

$_SESSION['goal'] = $goal1 = $r_meal_info['primary_goal'];

$_SESSION['weight'] = $weight1 = $r_meal_info['weight'];

$_SESSION['feet'] = $feet1 = $r_meal_info['height_feet'];

$_SESSION['inch'] = $inch1 = $r_meal_info['height_inc'];

$_SESSION['aclev'] = $aclev1 = $r_meal_info['activity_level'];

?>

 

Im assuming it would be in init.php since base.php is commented out

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.