NeoAshura
asked on
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
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>";
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
again you are a legend, 10/10
Thanks
<?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>";
}
?>