Hi,
I'm having intermittent problems with queries from my php script to a
postgresql database.
I have a form where I can enter a search query - for instance a last
name. This leads to a results page with a brief bit of information
about each of the matching results. From there, I can click a link
associated with any of the results which takes me to a page with all of
the details. Pretty standard stuff.
Problem I'm having is that for some of the results, when I click the
link to go to the full details page, no information is returned by the
script. I basically end up with my html template & no data populated.
For the majority of items, things work just fine.
One thing I've noticed is that it seems to be reproducable - that is,
for example item 5123 always fails to return any results on the full
details page.
from my PHP script (with item id 5123) & it returns the data.
So what could the problem possibly be?
I thought that perhaps it was a load issue on the server - couldn't
answer the query, but the fact that it's reproducible seems to nix that
idea. Also, that Postgres box has 3.5 GB of RAM & we're talking about
a test system at this point - I'm the only one using it.
Code for my first search results page (basic info & hyperlinks) looks
like this ($name_last is the variable passed from the search form):
$connection=pg_ connect("host=1 0.10.10.2 port=5432 dbname=db1
user=dbuser password=passwo rd");
$myresult = pg_exec($connec tion, "SELECT identification_ no, name_last
, name_first, name_middle FROM public.j_identi fication WHERE name_last
~*
'$name_last'");
The code for my detailed results page looks like this:
$connection = pg_connect("hos t=10.10.10.2 port=5432 dbname=db1
user=dbuser password=passwo rd");
$myresult = pg_exec($connec tion, "SELECT * FROM
public.archived _with_photos
WHERE identification_ no = '$id_no'");
'public.archive d_with_photos' is a view defined on the postgresql
server.
I can run the query
SELECT * FROM public.archived _with_photos WHERE identification_ no =
'5123';
and it returns all of the associated data from the database... whereby
the exact same query failed with the PHP script.
Any help or ideas greatly appreciated!
I'm having intermittent problems with queries from my php script to a
postgresql database.
I have a form where I can enter a search query - for instance a last
name. This leads to a results page with a brief bit of information
about each of the matching results. From there, I can click a link
associated with any of the results which takes me to a page with all of
the details. Pretty standard stuff.
Problem I'm having is that for some of the results, when I click the
link to go to the full details page, no information is returned by the
script. I basically end up with my html template & no data populated.
For the majority of items, things work just fine.
One thing I've noticed is that it seems to be reproducable - that is,
for example item 5123 always fails to return any results on the full
details page.
>From my Postgres box (windows 2003), I can run the exact same query as
So what could the problem possibly be?
I thought that perhaps it was a load issue on the server - couldn't
answer the query, but the fact that it's reproducible seems to nix that
idea. Also, that Postgres box has 3.5 GB of RAM & we're talking about
a test system at this point - I'm the only one using it.
Code for my first search results page (basic info & hyperlinks) looks
like this ($name_last is the variable passed from the search form):
$connection=pg_ connect("host=1 0.10.10.2 port=5432 dbname=db1
user=dbuser password=passwo rd");
$myresult = pg_exec($connec tion, "SELECT identification_ no, name_last
, name_first, name_middle FROM public.j_identi fication WHERE name_last
~*
'$name_last'");
The code for my detailed results page looks like this:
$connection = pg_connect("hos t=10.10.10.2 port=5432 dbname=db1
user=dbuser password=passwo rd");
$myresult = pg_exec($connec tion, "SELECT * FROM
public.archived _with_photos
WHERE identification_ no = '$id_no'");
'public.archive d_with_photos' is a view defined on the postgresql
server.
I can run the query
SELECT * FROM public.archived _with_photos WHERE identification_ no =
'5123';
and it returns all of the associated data from the database... whereby
the exact same query failed with the PHP script.
Any help or ideas greatly appreciated!
Comment