[PHP & MySQL] Dates >.<

SineCosine

I'm still looking for my Tangent
Reaction score
77
Another question just popped up into my mind ._.

Code:
Array
(
    [0] => July 18 2010
    [Date] => July 18 2010
)

Why does mysql_fetch_array() return an array with two sizes?
Namely, why does Array[0] exist at all? O_O

Just a thought XD
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
It says that it returns an associative array of strings ._.

But doesn't mysql_fetch_array() do that, too?
After all:
Code:
$Resource = mysql_query("SELECT * FROM Some_Table WHERE SomethingUnique='Trollolololololololol'");
$Row = mysql_fetch_array($Resource);

echo $Row['SomeColumnName'];

/////////////////////////////////////////////////
$Resource = mysql_query("SELECT * FROM Some_Table WHERE SomethingUnique='Trollolololololololol'");
$Row = mysql_fetch_assoc($Resource);

echo $Row['SomeColumnName'];

//They both work the same way... =/

Or is it that using mysql_fetch_array() with "SELECT ColumnName AS NewName" doesn't work? ._.
 

celerisk

When Zerg floweth, life is good
Reaction score
62
When given a link to documentation, the recommended procedure goes as follows:

- Click the link
- Read it
- Read it beyond the first sentence
- Follow the link in the second sentence
- Read that too
 

codemonkey

Code monkey not crazy, just proud.
Reaction score
66
I would just like to interject in this thread and beg you to stop naming your variables with a capital letter. It is very annoying to read. :p
 

codemonkey

Code monkey not crazy, just proud.
Reaction score
66
I don't get what's wrong with a capital-lettered variable =/

It's pointless for one thing. It just annoys me reading PHP variables that are capitalized. You'll never see any PHP script capitalize their variables. :p
 

perkeyone

something clever
Reaction score
71
naming the convention for variables, classes, and methods vary slightly between different programming languages but capitalization of the first letter is reserved for classes, or at least it is for the programming languages that i use. variables are usually written in "camelCaps" or "camelCase" leaving the first letter lowercase. following these naming conventions is not required for your code to work but it does help other people to understand your code, similar to comments. its just good coding practice.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top