Solved

mysql connection with jQuery and .ajax

Posted on 2011-02-16
2
1,352 Views
Last Modified: 2012-06-21

I am slowly and painstakingly succeeding in applying AJAX with jQuery but occasionally I hit little walls.

This time I am chasing my tail with the following error messages:

1) Access denied for user 'secems'@'localhost' (using password: NO) in /home/s
2) A link to the server could not be established in /home/

What I have managed to understand is that when I use ajQuery approach and my call back function sends the URL, the actual php pages that are undelying are the cause. Now the code used to work _before_ i transfered some functionalities to jQuery...so I figure that all php code that is now part of a callback function does not benefit from "connections" made in the main PHP.

Anway, my question is:
Is there a way to have the underlying php which each may have 1 or 2 includes to other php files, is there a way to establish a connection that each of these files can use?

Thanks
0
Comment
Question by:gbeaulac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 34913047
Create your connection string page separately and include it in every page where you need to interact with database and database connection.
0
 

Author Comment

by:gbeaulac
ID: 34913239
Thanks that does it.
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question