View Full Version : create link

03-27-2008, 11:23 PM
Hi, I created database called "Homepage", and i created table called "homenews" inside of "homepage" database.
I also created two column which is "News_Name" and "News_URL".

I use dreamweaver and is works great when i retreive from databse, but i want to change to have link, let say first colmn for "news_name i put cnn, and second colmn for News_URL i put www.cnn.com, my question is that how i can write php code to create url link of "www.cnn.com" on the text called "cnn" when retreive from database!

is this is correct code!

<?php echo '<a href="'.$row_HomeNews[News_URL].'">'.$row_HomeNews[News_Name ].'</a>'; ?>

if so when why I'm getting errors!


03-27-2008, 11:25 PM
Is $row_HomeNews defined as the mysql array? Post the full code and we can be of some more help.

03-27-2008, 11:53 PM
when i used dreamweaver

<?php echo $row_HomeNews['News_Name']; ?>
<?php echo $row_HomeNews['News_URL']; ?>

yes is $row...

so how can i write tha code!