|
|
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
|
|
|
|
|
|
omg... I make one little change, and now it doesn't work I tried debugging it for like an hour <?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!
"Behold: me! I have authority in this building."
|
|
|
|
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
|
|
|
|
|
|
|
When people do what? Find little mistakes that I continuously miss Oh Don't worry, you'll get the hang of it
|
CT Graphics Coding & Design
|
|
|
|
That happened to me all the time when I was just starting. One time I just hit the ` key while tabbing and took me freaking forever to find the error.
|
|
|
|
|
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
|
CT Graphics Coding & Design
|
|
|
|
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 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 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 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.
|
|
|
|
|
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
|
|
|
|
|
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;
|
|
|
|