I need to pull data from mysql and past it into a webpage.
The db is 'comments' and the field I need is 'id'
I don't need do to anything with it but echo it but I don't know how to right the code for it. Can someone please help me real fast?
I need to pull data from mysql and past it into a webpage.
The db is 'comments' and the field I need is 'id'
I don't need do to anything with it but echo it but I don't know how to right the code for it. Can someone please help me real fast?
Last edited by Dirt_Diver; 01-08-2009 at 03:06 PM.
Here:
Replace table with your table name.PHP Code://connect
$query = mysql_query('SELECT * FROM `table`'); //replace table with your table
while($row = mysql_fetch_assoc($query)){
echo $row['id'];
}
Jeremy | jfein.net
Dirt_Diver (01-08-2009)
Yes perfect thank you so much Nile.
I'm glad to help you anytime Dirt_Diver. Please read some MySQL tutorials though - this is a vary simple script that I coded with in 5 seconds.
Jeremy | jfein.net
Dirt_Diver (01-09-2009)
Bookmarks