RE: [SPAM] [PHP-DB] Global Peace output
| From: | Vincent Jordan | Date: | Sun, 22 Aug 2004 22:32:18 +0000 |
| Subject: | RE: [SPAM] [PHP-DB] Global Peace output | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35849@lists.php.net to get a copy of this message | ||
You have no html link. Try
echo " $company <br><a
href='$webaddress'>$webaddress</a><br>"
> -----Original Message-----
> From: Remember14a@aol.com [mailto:Remember14a@aol.com]
> Sent: Sunday, August 22, 2004 5:33 PM
> To: php-db@lists.php.net
> Subject: [SPAM] [PHP-DB] Global Peace output
>
> Dear friends,
>
> I have pasted table structure and
> php script
>
> below,
>
> Output I am getting is company name and web address,
> like pasted below
>
>
>
> Global Coalition For Peace
> http://www.globalcoalitionforpeace.net/
> Physicians For Social Responsibility
> http://www.psr.org/
>
> However, I want output page to print,url with link to website,
> With present script, its printing web address in table, however, onclick
> it
> doesn't take me to website.
>
> Any guidance, so that onclick, its takes, to website in "webaddress"
> column,
> please.
> --------------------------------------------------------------------------
> ----
> -------------
> table structure
> --------------------------------------------------------------------------
> ----
> -------------
>
> mysql> use b
> Database changed
> mysql> describe comp;
> +------------+--------------+------+-----+---------+----------------+
> | Field | Type | Null | Key | Default | Extra |
> +------------+--------------+------+-----+---------+----------------+
> | id | int(5) | | PRI | NULL | auto_increment |
> | company | varchar(100) | | PRI | | |
> | webaddress | varchar(100) | | PRI | | |
> +------------+--------------+------+-----+---------+----------------+
> 3 rows in set (0.00 sec)
>
> mysql>
> --------------------------------------------------------------------------
> -
> php script
> -------------------------------------------------------------------------
> <?php
>
> include 'menufile.php';
> ?><center>
> <?php
> // open the connection
> $conn = mysql_connect("localhost", "", "");
>
> // pick the database to use
> mysql_select_db("b",$conn);
>
> // create the SQL statement
> $sql = "SELECT * FROM comp ORDER BY company";
>
> // execute the SQL statement
> $result = mysql_query($sql, $conn) or die(mysql_error());
>
> //go through each row in the result set and display data
> while ($newArray = mysql_fetch_array($result)) {
> // give a name to the fields
> $id = $newArray['id'];
> $company = $newArray['company'];
> $company = $newArray['company'];
> $webaddress = $newArray['webaddress'];
> //echo the results onscreen between ""can also //type$id is and
> &company
> is
> echo " $company <br>$webaddress<br>";
> }
> ?></center>
>
>
>
>
>