Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Mithras

Mithras Avatar

****
Studio Member

600


July 2006
Shall I kill myself now or later?

I forgot the semicolon :P


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
mithras said:
I think it was with how I was setting up my column for the date/time. When I specify the type of data to go into the column, do I keep the parenthases empty, or actually put in the letters?


Set them to TEXT and use php to define what is the format of the date is


Mithras

Mithras Avatar

****
Studio Member

600


July 2006
YES!

Sorry for that little outburst, but I just made my first successful database transfer! :D :D :D


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

Mithras

Mithras Avatar

****
Studio Member

600


July 2006
omg...

I make one little change, and now it doesn't work :P

I tried debugging it for like an hour :P


<?php
$connect = mysql_connect('db517.perfora.net','dbo176379262','****');
if(!$connect) {
   die('Could not connect: ' . mysql_error() . '<br /><br />Please try again later');
}
mysql_select_db('db176379262');

$result = mysql_query("SELECT entry, name, date, content, comments FROM blogdb");

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
   $entry = $row['entry'] + 1;
   echo '<font size="2">(' . $entry . ')</font><b><font size="3"> Posted By: '. $row['name'] . ' -- On: ' . $row['date'] . '</b></font></b><br />' . $row['content'];
   if($row['comments'] == 1) {
      echo '<br /><a href="?comments=' . $row['entry'] . '">1 Comment</a>';
   }
   else if($row['comments'] > 1) {
      echo '<br /><a href="?comments=' . $row['entry'] . '">'. $row['comments'] . ' Comments</a>';
   }
   echo '<br /><hr width="98%" />';
}
?>



Last Edit: Oct 18, 2006 1:09:17 GMT by Mithras


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

Cr0w

Cr0w Avatar

**
Official Member

84


April 2006
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

Change to:
while ($row = mysql_fetch_assoc($result)) {


Last Edit: Oct 18, 2006 1:33:39 GMT by Cr0w
CT Graphics Coding & Design

Mithras

Mithras Avatar

****
Studio Member

600


July 2006
Do you have any idea how much I hate when people do that.

<_<

>_>

It worked.


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

Cr0w

Cr0w Avatar

**
Official Member

84


April 2006
When people do what? :-/

Anyway, glad it works. :)
CT Graphics Coding & Design

Mithras

Mithras Avatar

****
Studio Member

600


July 2006
cr0w said:
When people do what? :-/


Find little mistakes that I continuously miss :P


Support Rob Scuderi, the #1 Penguins Defender!

lucifer said:
"Behold: me! I have authority in this building."

Cr0w

Cr0w Avatar

**
Official Member

84


April 2006
mithras said:
cr0w said:
When people do what? :-/


Find little mistakes that I continuously miss :P


Oh :P

Don't worry, you'll get the hang of it :)
CT Graphics Coding & Design

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
That happened to me all the time when I was just starting. :P One time I just hit the ` key while tabbing and took me freaking forever to find the error. :(

Cr0w

Cr0w Avatar

**
Official Member

84


April 2006
I also hate it when you have a really long piece of PHP, and your variable is named something like MemName, but you accidentally put in something like memName and it takes forever to find :P
CT Graphics Coding & Design

Simie

Simie Avatar

******
ProScripter

1,052


May 2006
cr0w said:
I also hate it when you have a really long piece of PHP, and your variable is named something like MemName, but you accidentally put in something like memName and it takes forever to find :P


Thats why you make yourself a style :) small letter at the beginning, capital for every word after that :) I use that and I've never had an error :)

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
simie said:
cr0w said:
I also hate it when you have a really long piece of PHP, and your variable is named something like MemName, but you accidentally put in something like memName and it takes forever to find :P


Thats why you make yourself a style :) small letter at the beginning, capital for every word after that :) I use that and I've never had an error :)


I do that for function names and associative arrays mainly. For variables it should be a nice, one word description, or maybe a letter abbreviation.

Simie

Simie Avatar

******
ProScripter

1,052


May 2006
cddude229 said:
simie said:


Thats why you make yourself a style :) small letter at the beginning, capital for every word after that :) I use that and I've never had an error :)


I do that for function names and associative arrays mainly. For variables it should be a nice, one word description, or maybe a letter abbreviation.

I agree, but for a longer name that's the best way :)

Llanilek

Llanilek Avatar
Former Elite Mod

****
Dedicated Studio Member

931


October 2005
you shouldn't have long variable names... if its more than one word to identify a variable name used more than once but is for a different thing like ID it should be

$p_id;
$t_id;

newBookmarkLockedFalling