Jump to content

adding a link in this CONCAT query mingled with html


new_england

Recommended Posts

I am pulling my hair out trying to add an email link into this query.  I almost had it, but it seems to link everything from email down and without the email address being linked.  This is NOT the same question I had before if someone is wondering why I started a new thread.  This is completely a different link issue.  Here's my query and you'll see email half way through the string. Oh, and you're probably wondering why I mingled html in the CONCAT query.  Long story!!!  Here's the string and thanks

	$query = "SELECT CONCAT(yacht_name, '<p><br><b>Position:</b></p> ', position, '<p><br><b>Motor or Sail:</b></p> ', motor_sail, '<p><br><b>Length of Yacht:</b></p> ', length, '<p><br><b>Salary:</b></p> ', salary, '<p><br><b>Location:</b></p> ', location, '<p><br><b>Start Date:</b></p> ', start_date, '<p><br><b>Comments:</b></p> ', comments, '<td valign=top><p><br><b>Name of Contact:</b></p> ', name_contact, '<p><br><b>Phone 1:</b></p> ', phone_1, '<p><br><b>Phone 2:</b></p> ', phone_2, '<p><br><b>E-Mail:</b></p> ', email, '<p><br><b>Ticket(s) Required:</b></p> ', ticket, '<p><br><b>Position Filled:</b></p> ', position_filled, '<p><br><b>Date Registered:</b></p> ', DATE_FORMAT(registration_date, '%d %M %Y')) FROM users WHERE user_id=$id";		

 

$query = "SELECT yacht_name, position, motor_sail, length, salary,
 location, start_date, comments, name_contact, phone_1, 
phone_2, email, ticket, position_filled, DATE_FORMAT(registration_date, '%d %M %Y')
FROM users
WHERE user_id=$id;"

$result = mysql_query($query) or die(mysql_error());

while(list($yacht_name, $position, $motor_sail, $length, $salary,
 $location, $start_date, $comments, $name_contact, $phone_1, 
$phone_2, $email, $ticket, $position_filled, $regDate) = mysql_fetch_array($result)){


echo "$yacht_name";
echo "<p><br><b>Position: $position</b></p>";
echo "<p><br><b>Motor or Sail: $motor_sail</b></p>";
echo "<p><br><b>Length of Yacht: $length</b></p>";
echo "<p><br><b>Salary: $salary</b></p>";
echo "<p><br><b>Location: $location</b></p>";
echo "<p><br><b>Start Date: $start_date</b></p>";
echo "<p><br><b>Comments: $comments</b></p>";
echo "<td valign=top><p><br><b>Name of Contact: $name_contact</b></p>";
echo "<p><br><b>Phone 1: $phone_1</b></p>";
echo "<p><br><b>Phone 2: $phone2</b></p>";
echo "<p><br><b>E-Mail: $email</b></p>";
echo "<p><br><b>Ticket(s) Required: $ticket</b></p>";
echo "<p><br><b>Position Filled: $position_filled</b></p>";
echo "<p><br><b>Date Registered: $regDate</b></p>";

}

 

Something like that would probably work.  I'm pretty sure you're using CONCAT() incorrectly, and it made me cry to look at all that HTML in the MYSQL query.  If you use my example, you can fix the HTML to be however you want, I just formatted it that way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.