I am using Ajax to send requests for php from some text.
$ .get ("process.php", {finalQuery: finalQuery}, function (data) {warning ("data loaded:" + data);});
I know this job because I can put
$ val = $ _GET ['finalQuery'] in php; Resonate $ val;
and it shows the correct data, however, if I
$ db = pg_Connect ("host = localhost port = 5432 dbname = blah user = postgres password = 1888 "); Pg_close ($ Database);
This stops reverting the results back to Javascript if I use a different port or name, and it does not connect, then send the data to javascript and right Data goes back to output.
So basically, when I connect to the database, I can not refund my results with echo. I am doing the wrong
Edit ( Updates):? Full php code here
& lt; Php $ val = $ _GET ['finalQuery']; Resonate $ val; $ Db = pg_Connect ("host = localhost port = 5432 dbname = blah user = postgres password = 1888"); $ Result = pg_query ($ db; Choose from "GID FROM" Perfect "'); While ($ line = pg_fetch_row ($ result)) {resonant "gid: $ line [0]"; Echo "
; \ n"; } Pg_close ($ db); ? & Gt; However, the problem still occurs until all the lines I use using pg_connect can be removed and the problem persists as long as I remove pg_connect, the problem Disappears and I can send information back via echo New edit (debugging):
The connection database and php code are correct After loading with php page
error_reporting (-1); Ini_set ('display_errors', 'on'); No errors are logged on the page, and connection to the database is returning all the data properly on all page loads. The problem occurs when I'm trying to connect to PHP via Javascript.
The page sometimes loads the data properly, but it is random, and most of the time (nothing is php log errors). If you have no way, then JavaScript-PHP connection If the problem is not there, I'll debugging the code.
Here are the steps I would like to debug: There is a problem between postgres and PHP more than the possibility.
No comments:
Post a Comment