Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 722115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:57:07+00:00 2026-05-14T05:57:07+00:00

First, thanks for all the help I’ve received so far from StackOverflow. I’ve learned

  • 0

First, thanks for all the help I’ve received so far from StackOverflow. I’ve learned much.

Once again, I’m posing a rudimentary question that I’ve searched on, but cannot find the exact answer to. Here or on PHP.net.

It’s sort of like what this guy asked, but not exactly: Mysql throwing query error yet finishing query just fine-why?

So, I saw my errorlog ballooning up when I checked my site directory and opened to notice that a bunch of errors have been recorded since I wrote this new Admin area. I know something is obviously awry with my scripting for the error to be thrown, but the weird thing is, the script actually runs through and pulls all the data I need without breaking.

The log contains:

PHP Warning: mysql_query() [function.mysql-query]: Access denied for user ‘someuser’@’localhost’ (using password: NO) in /home/mysite/adminconsole.php on line 15

I don’t get that because that very line is where I setup my connection… the exact same way I do it everywhere else on the site with no problem.

After that error, I have these thrown at the same time

[09-Apr-2010 08:44:18] PHP Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/mysite/adminconsole.php on line 15

[09-Apr-2010 08:44:18] PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mysite/adminconsole.php on line 16

From what I read in the other guys thread, the problem is the contents of the query maybe? Maybe my query is malformed?

Thanks so much for any guidance you can provide.

-Rob

ADD: To Dominic

Dominic

session_start();
if (isset($adminusr))
{
mysql_connect("localhost","user","pw") or die(mysql_error());
mysql_select_db("my_db") or die(mysql_error());
}

else    {
header("location:admin.php");
}

LINE 14 #SETUP THE QUERIES HERE FROM SESSION INFO

LINE 15 $sql1=mysql_query("SELECT * FROM admins WHERE username='$adminusr'"); ///connecting to the admin DB

LINE 16 $result1=mysql_fetch_array($sql1);

### OLD BAR INFO QUERY
$sql2=mysql_query("SELECT * FROM bars WHERE bar_id='$result1[bar_id]'"); ///connecting to the old bars DB
$result2=mysql_fetch_array($sql2);

###LIQUOR QUERIES
$sql3=mysql_query("SELECT * FROM inv_beer WHERE bar_id='$result1[bar_id]'"); ///connecting to the BEER INVENTORY DB
$beer_results=mysql_fetch_array($sql3);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:57:07+00:00Added an answer on May 14, 2026 at 5:57 am

    If $adminusr isn’t set the first time, no connection is made to the database. Put an exit() call after the header call.

    After header is called, the script continues to run. That is why you get errors in the logs but don’t notice them when using the site.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 407k
  • Answers 407k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Since you didn't fill the area with background of image… May 15, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer Have you tried generating a client proxy from the wsdl?… May 15, 2026 at 6:37 am
  • Editorial Team
    Editorial Team added an answer Paperclip is pretty noisy when it fails to delete a… May 15, 2026 at 6:37 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.