Hi
I am in the middle of making a edit customers details php page and came across a id issue, it is adding odd numbers to the id instead of the correct id it should be
below is my coding for the view customers php page
<?php
$con= mysqli_connect("localhost", "username", "password", "username");
if(!$con)
{
die('not connected');
}
$con= mysqli_query($con, "SELECT plans_name, machine1, machine2, machine3, machine4, machine5, customer_name, customer_email, customer_phone, DATE_FORMAT(date_purchased_plan, '%d/%m/%Y') AS date_purchased_plan from plans");
?>
<div>
<td>Customers</td>
<table>
<th>Support Plan</th>
<th>Machine 1</th>
<th>Machine 2</th>
<th>Machine 3</th>
<th>Machine 4</th>
<th>Machine 5</th>
<th>Customer Name</th>
<th>Customer Email</th>
<th>Customer Phone</th>
<th>Plan Purchase Date</th>
<th colspan="2">Actions</th>
</tr>
<?php
while($row= mysqli_fetch_array($con))
{
?>
<tr>
<td><?php echo $row['plans_name']; ?></td>
<td><?php echo $row['machine1']; ?></td>
<td><?php echo $row['machine2']; ?></td>
<td><?php echo $row['machine3'] ;?></td>
<td><?php echo $row['machine4'] ;?></td>
<td><?php echo $row['machine5'] ;?></td>
<td><?php echo $row['customer_name'] ;?></td>
<td><?php echo $row['customer_email'] ;?></td>
<td><?php echo $row['customer_phone'] ;?></td>
<td><?php echo $row['date_purchased_plan'];?></td>
<td><a href="edit-customer.php?id=' . $row['id'] . '">Edit</a></td>
<td><a href="delete.php?id=' . $row['id'] . '" onClick="return confirm('."'Are you sure you want to delete this record?');".'">Delete</a></td>
</tr>
<?php
}
?>
</table>
</div>
In the url when I click on edit, the url looks like the following
http://www.it-doneright.co.uk/admin/edit-customer.php?id=%27%20.%20$row[%27id%27]%20.%20%27
see the issue with the %27%20 etc.
is there something I need to add in the view-customers.php file?
Thank you in advance
Ian