Reply to Re: change space to hyphen in sql query results

Your name:

Reply:


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"]).
"&amp;Search=Search\">{$get["name"]}</a>".
$get["name"]."<br />";
}
}



--

- lΓΌpher
---------------------------------------------
"Man sieht nur das, was man weiß" (Goethe)

[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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация