Hello,
This one is probably easy for a season php-er...but I am a total novice. I have been charged with making this work.
I have an existing database and all else seem to be working fine. The following coding works well IF I don't have the "a href" parts in there.
Can someone steer me in the right direction and help me get the links working right? It is self-explanatory what I am trying to do by looking at my code...but I just don't know enough to get it working right.
I would appreciate any help!
-------code------
<?
$db_name= "heinzchapel";
$table_name= "vender";
$connection = @mysql_connect("localhost","bart","bart"
or die ("Cannot get a connection"
$db= @mysql_select_db($db_name, $connection)
or die ("Cannot get an connection"
$sql= "Select vendername,address1,address2,city,state,zip,phone_num,emailaddress,url
From $table_name
where florist= 'YES'
order by vendername;";
$result =@mysql_query($sql,$connection) or die ("Could not execute querey"
while ($row= mysql_fetch_array($result)) {
$vendername =$row ['vendername'];
$address1 = $row['address1'];
$address2 = $row['address2'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zip'];
$phone_num = $row['phone_num'];
$emailaddress = $row['emailaddress'];
$url = $row['url'];
$display_block .= "
<p>
<b>$vendername</b><br>
$address1<br>
$address2<br>
$city, $state $zip<br>
<b>Phone:</b> $phone_num<br>
<b>eMail:</b> <a href='mailto:$emailaddress'>$emailaddress</a><br>
<b>On the Web:</b> <a href='</p>
";}
?>
-------more------
I KNOW the problem is in the following section:
$display_block .= "
<p>
<b>$vendername</b><br>
$address1<br>
$address2<br>
$city, $state $zip<br>
<b>Phone:</b> $phone_num<br>
<b>eMail:</b> <a href="mailto:$emailaddress">$emailaddress</a><br>
<b>On the Web:</b> <a href="</p>
";}
Is it the quotations? Or maybe just the whole way I have the links written? It works fine without the <a href ...> in there. But I need those addresses to be links!
Thanks!
-----------------------------------------------
These are endless galaxies which are yours.
You can journey to infinity
through the endless passages of the cosmos.
Even better. This all belongs to you.
This is your mind.
This one is probably easy for a season php-er...but I am a total novice. I have been charged with making this work.
I have an existing database and all else seem to be working fine. The following coding works well IF I don't have the "a href" parts in there.
Can someone steer me in the right direction and help me get the links working right? It is self-explanatory what I am trying to do by looking at my code...but I just don't know enough to get it working right.
I would appreciate any help!
-------code------
<?
$db_name= "heinzchapel";
$table_name= "vender";
$connection = @mysql_connect("localhost","bart","bart"
or die ("Cannot get a connection"
$db= @mysql_select_db($db_name, $connection)
or die ("Cannot get an connection"
$sql= "Select vendername,address1,address2,city,state,zip,phone_num,emailaddress,url
From $table_name
where florist= 'YES'
order by vendername;";
$result =@mysql_query($sql,$connection) or die ("Could not execute querey"
while ($row= mysql_fetch_array($result)) {
$vendername =$row ['vendername'];
$address1 = $row['address1'];
$address2 = $row['address2'];
$city = $row['city'];
$state = $row['state'];
$zip = $row['zip'];
$phone_num = $row['phone_num'];
$emailaddress = $row['emailaddress'];
$url = $row['url'];
$display_block .= "
<p>
<b>$vendername</b><br>
$address1<br>
$address2<br>
$city, $state $zip<br>
<b>Phone:</b> $phone_num<br>
<b>eMail:</b> <a href='mailto:$emailaddress'>$emailaddress</a><br>
<b>On the Web:</b> <a href='</p>
";}
?>
-------more------
I KNOW the problem is in the following section:
$display_block .= "
<p>
<b>$vendername</b><br>
$address1<br>
$address2<br>
$city, $state $zip<br>
<b>Phone:</b> $phone_num<br>
<b>eMail:</b> <a href="mailto:$emailaddress">$emailaddress</a><br>
<b>On the Web:</b> <a href="</p>
";}
Is it the quotations? Or maybe just the whole way I have the links written? It works fine without the <a href ...> in there. But I need those addresses to be links!
Thanks!
-----------------------------------------------
These are endless galaxies which are yours.
You can journey to infinity
through the endless passages of the cosmos.
Even better. This all belongs to you.
This is your mind.