Reply to SQL query question

Your name:

Reply:


Posted by Dan on 11/20/06 23:52

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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация