Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 4th, 2002, 08:12 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Post Article Discussion: Quick and Dirty Emoticons

Quick and Dirty Emoticons If you have any questions or comments about this article then please post them here.

You can read the article here .

Reply With Quote
  #2  
Old August 12th, 2002, 10:21 PM
WebGuy WebGuy is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 54 WebGuy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Hi all,

I understand everything that Harvard says in his article, but I don't understand this part of the code. (I've bolded the part that I don't understand.)

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

When I create PHP scripts, I usually use something like:
PHP Code:
<?php

// Retrieve all authors from the database
$sql mysql_query("SELECT * FROM AuthorsTemp");
// If the above query has an error, echo the error
if (!$sql) {
  
errorMsg("Database Error""<p>Cannot retrieve authors: " .
        
mysql_error() . "</p>");
  exit;
// End error check on $sql

// While loop for $sql
while($row mysql_fetch_array($sql)) {
$id        $row["ID"];
$firstname $row["Firstname"];
$lastname  $row["Lastname"];
$email     $row["Email"];
?>
<tr>
    <td align="center"><?php echo($id); ?></td>
    <td align="center"><?php echo($firstname); ?></td>
    <td align="center"><?php echo($lastname); ?></td>
    <td align="center"><a href="mailto:<?php echo($email); ?>"><?php echo($email); ?></a></td>
    <td align="center"><a href="deltempauthor.php?id=<?php echo($id); ?>">X</a></td>
</tr>
<?php
}
?>
So basically my question is: why is there the , MYSQL_ASSOC?

Thanks,
__________________
Sincerely,
Corbb O'Connor, Author at DevArticles

Last edited by WebGuy : August 12th, 2002 at 10:30 PM.

Reply With Quote
  #3  
Old August 12th, 2002, 10:31 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
that means the columns are loaded into an associative array

like

SELECT id, name FROM blabablablablablablbal

$row['id'], $row['name']

but you can take that out, and it should still work

Reply With Quote
  #4  
Old August 12th, 2002, 10:44 PM
WebGuy WebGuy is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 54 WebGuy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
So why take up file size with this command?

Reply With Quote
  #5  
Old December 31st, 2003, 02:00 AM
jammo jammo is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 jammo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to jammo Send a message via Yahoo to jammo
[newbie alert]
i've just completed this article.
i also did this one: Building A Quick-And-Dirty PHP/MySQL Publishing System @ URL

my publishing system is working well.
i would like to know HOW to put the two together.

(remember, im a newbie.)

[/newbie alert]

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Quick and Dirty Emoticons


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT