hye all , i have problem with echo inside echo . the original code is like this:
<input type="button" value="Update" onClick="window.location.href='edit_walkinnew.php?action=update&No=<?php echo $row['No'];?>'">
i want to echo this "Update button" into my search result , i writing like this :
echo '<td><input type="button" value="Update" onclick="window.location.href=\'edit_walkinnew.php?action=update&No=<?php echo $No; ?>\'"></td>';
the problem is when i click on that update button , the adress will be like this(the no is not called):
edit_walkinnew.php?action=update&No=
instead of
edit_walkinnew.php?action=update&No=847
(this is the code suppose to be) , i believe the problem is happen because of this line
php echo $No;
updated : When i clicked on Update the $No is still not appear
$sql="SELECT * FROM walkin2bck WHERE Date LIKE '%$search%' OR Name LIKE '%$search%' OR NRIC_No LIKE '%$search%' OR ContactNo LIKE '%$search%' OR Financial_Institution LIKE '%$search%' OR TypeofComplaint LIKE '%$search%' OR Typeofcase LIKE '%$search%' OR RefNo LIKE '%$search%' OR AttendBy LIKE '%$search%'";
$result = mysqli_query($con,$sql);
$No = $row['No'];
$total = 0;
$total = mysqli_num_rows($result);
echo "Searching for : ".$search."<br/>";
echo "Total Result : ".$total."<br/>";
if (mysqli_num_rows($result) > 0) {
echo "<table border='1' cellpadding='11'>
<tr>
<th>No</th>
<th>Date</th>
<th>Name</th>
<th>NRIC No</th>
<th>Contact No</th>
<th>Financial Institution</th>
<th>Type of Complaint</th>
<th>Type of case</th>
<th>Ref No</th>
<th>Attend By</th>
<th>Action</th>";
while($row = mysqli_fetch_assoc($result)) {
//echo "RG: " . $row["Registered_Date"]. " - T: " . $row["Type"]. " R" . $row["Ref_No"]. "<br>";
echo "<tr>
<td>".$row["No"]."</td>
<td>".$row["Name"]."</td>
<td>".$row["Name"]."</td>
<td>".$row["NRIC_No"]."</td>
<td>".$row["ContactNo"]."</td>
<td>".$row["Financial_Institution"]."</td>
<td>".$row["TypeofComplaint"]."</td>
<td>".$row["Typeofcase"]."</td>
<td>".$row["RefNo"]."</td>
<td>".$row["AttendBy"]."</td>";
echo '<td><input type="button" value="Update" onClick="window.location.href=\'edit_walkinnew.php?action=update&No=' . $No. '\'"></td>';
}
echo "</table><br/>";
echo "<a href='walkindetailnew.php'>Back to main</a>";
}else {
echo "0 results";
}
mysqli_close($con);
}
}