473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 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 1807
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cowboyx | last post by:
Is there a way to configure PHP to use case-insensitive variable names? I'd like to do this... $dbVars = pg_query( $connection, "SELECT columnName1, columnName2, columnName3 FROM table WHERE...
2
by: Joe Gazda | last post by:
I'm a relative newbie to PHP, but have been able to put together some PHP code to generate a CSV/XLS file from a Query result. Now, I would like to include custom column names instead of the MySQL...
46
by: James Harris | last post by:
Before I embark on a new long-term project I'd appreciate your advice on how to split up long names. I would like to keep the standards for command names the same as that for variable names....
1
by: VB Programmer | last post by:
I have a datagrid which is bound to a datatable that I create on the fly. How do I set the width of each column via code? Ex: Column 1 is always 100, Column 2 is always 250, etc... Thanks!
0
by: Matthew Morvant | last post by:
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) <? ...
4
by: Scot L. Harris | last post by:
Currently using Postgresql 7.2.4-5.80 with php 4.2.2.-8.0.8 on a redhat 8.0 system. I am writing some php scripts where I want to generate a list of the column names in a particular table that...
4
by: natG | last post by:
Hi; I am transferring data from MySql to db2 using my own java/jdbc program. Working out ok, except for the fact that our apps use mixed-case names for tables and columns. Although my CREATE TABLE...
8
by: sara | last post by:
I have a table where a few of the users entered vendor names ALL IN UPPER CASE. I have created forms to edit the data, but I can't seem to allow changing JOE SMITH to Joe Smith. What to I have...
3
by: Anita Potekkat | last post by:
Hello, I had a question regarding Case Sensitivity in 10g & 9i. (1) Does Case Sensitivity in Oracle have to do with data only? Or does it also effect table & column names? For e.g. in a table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.