here i created a link of the customer.
<a name="id" href="https://127.0.0.1/new taxicab/account/driver/profile/index.php?id=<?php echo $data['id']; ?>"><?php echo $data['fullname']; ?></a>
and the index.php is
<?php $connection = new mysqli("localhost", "root", "black9024!@","new_taxicab");
$id = ($_GET['id']);
if (empty($_GET['id'])){
header("location:cheat.php");
die();
$sql = "select * from driver where id = '$id'";
$result = $db->sql_query($sql) or die (mysqli_error($sql));
while($rws = mysqli_fetch_array($result)){}
echo $rws['fullname'];?>
<?php echo $rws['fullname'];
}
?>
but it can't work i know it wrong but what's write please give me some suggestion.
In your while loop the echo $rws['fullname'] is outside of the while's curly braces. Try:
<?php
$connection = new mysqli("localhost", "root", "black9024!@","new_taxicab");
$id = ($_GET['id']);
if (empty($_GET['id'])){
header("location:cheat.php");
die();
}
$sql = "select * from driver where id = '$id'";
$result = $db->sql_query($sql) or die (mysqli_error($sql));
while($rws = mysqli_fetch_array($result)){
echo $rws['fullname']; <-- Here
};
?>
<?php
$connection = new mysqli("localhost", "root", "black9024!@","new_taxicab");
if (empty($_GET['id'])){
header("location:cheat.php");
die();
}
$sql = "select * from driver where id = '$_GET[‘id’]'";
$result = $db->sql_query($sql) or die (mysqli_error($sql));
while($rws = mysqli_fetch_array($result)){
echo $rws;
};
?>
May have to change single quotes I typed this from my phone
@joseph_J your answer looks like it will work but do you need to echo out $rws itself?
From what I can see your not returning the data as an array with the items Id and full name?$data[‘id’]
where does this come from?