Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mysql connection with jQuery and .ajax

Posted on 2011-02-16
2
Medium Priority
?
1,363 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
2 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

963 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