[SOLVED] echo Dynamic data links ?
Posted: Sat Mar 13, 2004 10:59 pm
Hey All, here is the problem (other than the fact I started learning php yesterday! Newbie Alert!),
I've built a recordset which repeats listing all the data records, Got this working no problem. The problem I'm running into is two data types.
email & url.
I've got a simple data verifier which places "N/A" in the field if the mySQL field is = "". No Problem Here is a sample of that code.
The problem is for the email and url fields I need it to echo a string of code to place the href and mailto links if the data is not null. I had no problem creating the dynamic links without the if statement, but I want N/A to be displayed if the data field is empty. I can do each of these tasks seperatley, but mixed with the if statement and it falls apart!
This is what I've tried, but it's not working.
Because of stupidity reasons on my end it's not working. I'm assuming I have incorrect statements or structure.
Any help would be greatly appreciated.
FrogOnTOp
I've built a recordset which repeats listing all the data records, Got this working no problem. The problem I'm running into is two data types.
email & url.
I've got a simple data verifier which places "N/A" in the field if the mySQL field is = "". No Problem Here is a sample of that code.
Code: Select all
<?php if ($row_profiles['phone']=="") { echo 'N/A';} else { echo $row_profiles['phone'];} ?>This is what I've tried, but it's not working.
Code: Select all
<?php if ($row_profiles['email']=="") { echo 'N/A';} else { echo '<a href="mailto:<?php echo $row_profiles['email']?>">$row_profiles['email']?>"></a>';}?>Any help would be greatly appreciated.
FrogOnTOp