How to create a Hyperlink using MYSQL data to be passed into a url
Hi Experts,
What im trying to do is
Make some data from mysql into a hyperlink so when the hyperlink is pressed sends the hyperlink for example "0777777777" into the array and would then direct onto the next page.
so the url once the link is clicked would be something like
http://localhost/billing.php?val=07777777777
how would i make the 077777777 retrieved from the database into a link which sets as a variable?
this is what ive got so far. see attached
Many thanks for your help
<?php error_reporting(E_ALL);include 'myphp.php';$val = $_GET['val'];$sql = "SELECT * FROM customer_details WHERE customer_name = '" . $val . "'";$result = mysql_query($sql) or die(mysql_error() . " IN $sql"); $rs = mysql_query($sql);while($row = mysql_fetch_array($rs)){ echo"<table>"; echo "<tr><td>Customer:</td><td>".$row['customer_name']."</td></tr>"; echo "<tr><td>Mobile Number:</td><td>".$row['mobile_number']."</td></tr>"; echo"</table>";} ?>
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
<?php
error_reporting(E_ALL);
include 'myphp.php';
$val = $_GET['val'];
$sql = "SELECT * FROM customer_details WHERE customer_name = '" . $val . "'";
$result = mysql_query($sql) or die(mysql_error() . " IN $sql");
$rs = mysql_query($sql);
while($row = mysql_fetch_array($rs))
{
echo"<table>";
echo "<tr><td>Customer:</td><td
echo "<tr><td>Mobile Number:</td><td><a href=\"billing.php?val=".$
echo"</table>";
}
?>