Jump to content

[SOLVED] Need to SELECT a record and echo


nscherneck

Recommended Posts

<?php

$con = mysql_connect("database host", "username", "password");

$query = "SELECT col_1, col_2, col_3 FROM table";

$result = mysql_query($query, $con);

while($data = mysql_fetch_array($result))
{
  echo($data['col_1'].' '.$data['col_2'].' '.$data['col_3'].'<br />');
}

?> 

 

You'll have to substitute your database login information, column names, and table name of course...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.