TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-09-2009, 04:49 AM   #1 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default foreach statement?

Alright so I am looking to create a foreach statement using mysql query. I am not sure how I can do this seeing as how it requires an array_expression and value.

Here's my code:

PHP Code:
// Retrieve Data From The Database
$query 'SELECT * FROM entries ORDER BY DESC ID';

// Run The Above MySQL Query
$results 'mysql_query($query)'
How can i use the foreach statement to use the data over and over for each entry that has the ID tag.

Thanks,
Randy
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Save output from foreach into an array Sam Granger Absolute Beginners 2 01-15-2009 02:07 AM
if within a foreach ? Mithadriel Absolute Beginners 2 11-09-2008 12:20 AM
Ugh, Query in a while statement Aaron Absolute Beginners 2 08-11-2008 06:36 PM
Setting integer to 0 at start of foreach Haris General 0 10-12-2007 04:41 AM


All times are GMT. The time now is 08:43 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design