
March 30th, 2004, 04:56 PM
|
|
Registered User
|
|
Join Date: Mar 2004
Posts: 8
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
using links stored in MYSQL DB
I have a PHP page that allows a user, through a form, to post information to a MYSQL database. One of these fields is a url to another page. However when i try to display the record in this table on another page i cannot get the url to work. When this page is loaded i go through my DB and put all the fields into variables for each record. I then use an echo statement to display the variables in a table. I have the url in a variable called $site and I then try to display this link with the following:
<a href ="$site">Click here</a> This however gets me an error saying: Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' . I would appreciate any help on this matter that anyone can give me, i'm sure there is probably a very simple solution but as a new user of PHP i just can't seem to find it. Here is the code for this section of my page: Thank you again.
PHP Code:
//go through each row and display data while ($newarray = mysql_fetch_array($result)) { $id = $newarray['id']; $est_name = $newarray['est_name']; $address = $newarray['est_address']; $menu = $newarray['est_menu']; $site = $newarray['est_site']; $pic = $newarray['est_pic']; if ($newarray['est_pic'] == "") { echo "<table><tr> <td> name: $est_name<br><br> Address: $address<br> </td> <td> <strong>Menu:</strong>$menu<br> <strong>Website:</strong><a href ="$site">Click here</a> </td> </tr> </table> <HR WIDTH ='70%' ALIGN ='left'> ";
}
|