Built a URL from fix web address and selected DB field content

Dear all,

Can someone help please?
Next to other details I need to output a URL that consists of a fix web address and DB field content:

web address fix: www.domain-name/
DB-field retrieved: xxxxxx (field is named ‘slug’)
Html ending fix : .html

The clickable URL when constructed should look like this: www.domain-name/xxxxxx.html
I have all data available, but don’t know how to put these parts together, to output a clickable URL.

Furthermore: The fields currently printed are retrieved from one db row. I need to retrieve one more field from another db row and print it in the same row with the other fields.

Here is my current code:
[php]

Portfolio <?php // Connects to Database mysql_connect("localhost","user","passw") or die(mysql_error()); mysql_select_db("db-name") or die(mysql_error()); // here I select the first field into "$data" from "row-a" $data = mysql_query("SELECT * FROM **row-a**") // here I need to select another field into "$location" from another row (but don't know how to do) //---> $location = mysql_query("SELECT * FROM **another-row**") // this part prints all fine: or die(mysql_error()); Print ""; Print "

Portfolio Phuket Beachvillas / Phuket Strandvillas


"; Print "

"; Print ""; while($info = mysql_fetch_array( $data )) // while($info2 = mysql_fetch_array( $location )) { Print ""; Print " "; Print ""; Print ""; Print ""; Print ""; // here I need to print the other field from **another row** // Print ""; // and here I need to print the constructed URL: www.domain-name/'slug'.html // Print "
Villa Name Bedrooms Bathrooms Sleeps max. Location Site URL
".$info['ref_id'] . "".$info['bedrooms'] . " ".$info['bathrooms'] . " ".$info['max_occupants'] . " ".$info['slug'] . "
".$info2['location'] . " ......... } Print "
"; ?> [/php]

I would appreciate very much any help. Many thanks.

uhm… quite dead here… :frowning:
Have been at stackoverflow and got my answer in less than 2 hrs…
case closed

Sponsor our Newsletter | Privacy Policy | Terms of Service