471,108 Members | 1,239 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

Mixed Case column names (php 4.3.5 & pg 7.4.2)

Hello All,

I have a very simple page that illustrates an issue I am having. (Please
assume that dbConnect() returns a vaild connection and there is at least 1
record returned)

<?

include('GlobalFunctions.php');

$oConn = dbConnect();

$rsTest = pg_exec('SELECT "ridStudent" FROM "tblStudent"');

echo pg_fetch_result($rsTest,0,"ridstudent");

pg_close($oConn);
?>

Can anyone please explain why this doesn't work. I know that I can use an
all lowercase alias in the query, but there HAS to be an easier way. I
currently am referencing everything by ordinal, that is going to bite me
whenever someone decides to make a "simple" DB change. Is this pg_fetch
results even the best thing to use?

Thanks
Matthew

Nov 23 '05 #1
4 1766
Typo on that post. Here is what is should be:

echo pg_fetch_result($rsTest,0,"ridStudent");

which still doesn't work.
"Matthew Morvant" <uc*@bigfatreddog.com> wrote in message
news:U7***************@fe07.usenetserver.com...
Hello All,

I have a very simple page that illustrates an issue I am having. (Please assume that dbConnect() returns a vaild connection and there is at least 1
record returned)

<?

include('GlobalFunctions.php');

$oConn = dbConnect();

$rsTest = pg_exec('SELECT "ridStudent" FROM "tblStudent"');

echo pg_fetch_result($rsTest,0,"ridstudent");

pg_close($oConn);
?>

Can anyone please explain why this doesn't work. I know that I can use an
all lowercase alias in the query, but there HAS to be an easier way. I
currently am referencing everything by ordinal, that is going to bite me
whenever someone decides to make a "simple" DB change. Is this pg_fetch
results even the best thing to use?

Thanks
Matthew


Nov 23 '05 #2
Typo on that post. Here is what is should be:

echo pg_fetch_result($rsTest,0,"ridStudent");

which still doesn't work.
"Matthew Morvant" <uc*@bigfatreddog.com> wrote in message
news:U7***************@fe07.usenetserver.com...
Hello All,

I have a very simple page that illustrates an issue I am having. (Please assume that dbConnect() returns a vaild connection and there is at least 1
record returned)

<?

include('GlobalFunctions.php');

$oConn = dbConnect();

$rsTest = pg_exec('SELECT "ridStudent" FROM "tblStudent"');

echo pg_fetch_result($rsTest,0,"ridstudent");

pg_close($oConn);
?>

Can anyone please explain why this doesn't work. I know that I can use an
all lowercase alias in the query, but there HAS to be an easier way. I
currently am referencing everything by ordinal, that is going to bite me
whenever someone decides to make a "simple" DB change. Is this pg_fetch
results even the best thing to use?

Thanks
Matthew


Nov 23 '05 #3
Matthew Morvant wrote:
Typo on that post. Here is what is should be:

echo pg_fetch_result($rsTest,0,"ridStudent");

which still doesn't work.

Try:
echo pg_fetch_result($rsTest,0,"\"ridStudent\"");

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #4
Matthew Morvant wrote:
Typo on that post. Here is what is should be:

echo pg_fetch_result($rsTest,0,"ridStudent");

which still doesn't work.

Try:
echo pg_fetch_result($rsTest,0,"\"ridStudent\"");

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting
http://www.lingnu.com/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by cowboyx | last post: by
2 posts views Thread by Joe Gazda | last post: by
1 post views Thread by VB Programmer | last post: by
reply views Thread by Matthew Morvant | last post: by
4 posts views Thread by Scot L. Harris | last post: by
4 posts views Thread by natG | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.