SQL query question

Hi, I'm new to PHP so this might be a simple question to answer but I
just need a little help.

So basically I'm querying the database with this simple search SQL
statement:

$conn = db_connect();
$result = $conn->query( "SELECT name, url FROM table1 WHERE field1
LIKE'%$search%'");

where db_connect is just the connection to the database.

I want to use the name and url to fill up a table of all the search
results such as below:

echo "<tr bgcolor='$color'><td><a href=\"url\">".name."</a></td>";

I was just wondering how to get the $result so I can use it to fill up
the table and what type of loop I should use. Thanks!
dan [ Di, 21 November 2006 00:52 ] [ ID #1542083 ]

Re: SQL query question

Oh yeah, and I'm using MySQL in case you were wondering.
dan [ Di, 21 November 2006 01:00 ] [ ID #1543372 ]

Re: SQL query question

Dan wrote:
> Oh yeah, and I'm using MySQL in case you were wondering.

http://uk2.php.net/mysql_fetch_array
zac.carey [ Di, 21 November 2006 01:22 ] [ ID #1543373 ]
PHP » alt.php.sql » SQL query question

Vorheriges Thema: No-brainer mysql->html tables - sample code
Nächstes Thema: MySQL : use of create sequence statement