Posted by Lόpher Cypher on 01/02/06 04:40
emmakane@gmail.com wrote:
>
> <?
> require "config.php"; // All database details will be
> included here
> $page_name="test.php"; //
> $query="SELECT name FROM database1 ";
> $result=mysql_query($query);
> echo mysql_error();
> while($get = mysql_fetch_array($result))
> {
> echo '<a
> href=http://www.myurl.com/search.php?q=$get[name]&Search=Search>$get[name]<br>',
> urlencode($get[name]), '">';
>
> }
> ?>
>
....
>
> Could someone just show me exactly how to use this function? I'm stuck
> on this and can't move on. Everything I try fails in an error.
>
$query = "SELECT name FROM database1";
$result = mysql_query($query);
if ($result === false) {
echo mysql_error();
} else {
while($get = mysql_fetch_array($result)) {
echo "<a href=\"http://www.myurl.com/search.php?q=".
urlencode($get["name"]).
"&Search=Search\">{$get["name"]}</a>".
$get["name"]."<br />";
}
}
--
- lΓΌpher
---------------------------------------------
"Man sieht nur das, was man weiΓ" (Goethe)
Navigation:
[Reply to this message]
|