Hi im trying to put my javascript confirm delete on my delete link , I MA GETTING THIS ERROR syntax error, unexpected T_STRING in, im sure its all about my single quote and double quotes kindly help with this
the javascript works but i cannot fetch my id form the database , but itf i put the single quotes it does not work pls help me
$delete = '<a href='cat_delete.php?ategoryID=$row[0]' onclick="javascript:return confirm(\'Are you sure you want to delete ?\')">Delete</a>';
<?php
// Get details from database
$categoryID = $_POST['categoryID'];
$catname = $_POST['catname'];
$catpaid = $_POST['catpaid'];
if (isset($categoryID)) {
$displayError = messageDisplay($errorMessage['cannot_connect_to_db'],"error");
echo "</tr></table>
$displayError
<table><tr>";
} else {
$startVal = $start - 1;
$sql = "SELECT categoryID, name FROM Categories ORDER BY categoryID";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$categoryID = $row[0];
$catname = $row[1];
$catpaid = $row[2];
$contentDisplayed = $catpaid;
$contentDisplayed = strip_tags($catpaid);
$contentDisplayed = (strlen($contentDisplayed) > 200) ? substr($contentDisplayed,0,200)."..." : "$contentDisplayed";
$edit = "<a href='updatecategory.php?categoryID=$row[0]'>Edit</a>";
$delete = '<a href='cat_delete.php?categoryID=$row[0]' onclick="javascript:return confirm(\'Are you sure you want to delete ?\')">Delete</a>';
$class = ($class == "adminRow1") ? "adminRow2" : "adminRow1";
echo '<tr class="'.$class.'">'
.'<td>'.$categoryID.'</td>'
.'<td>'.$catname.'</td>'
.'<td style="text-align: center">'.$edit.'</td>'
.'<td style="text-align: center">'.$delete.'</td><div style="position: absolute; "></form></div></td>'
.'</tr>';
}
}
?>