Log in

View Full Version : Resolved I need some real simple fast help



Dirt_Diver
01-08-2009, 01:15 AM
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?

Nile
01-08-2009, 01:25 AM
Here:


//connect
$query = mysql_query('SELECT * FROM `table`'); //replace table with your table
while($row = mysql_fetch_assoc($query)){
echo $row['id'];
}

Replace table with your table name.

Dirt_Diver
01-08-2009, 01:31 AM
Yes perfect thank you so much Nile.

Nile
01-08-2009, 01:34 AM
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.