duniyadnd
10-27-2002, 07:59 AM
The problem lies in the fact that I click on a link and its a javascript function call "confirm" If user accepts, function goes to a particular page, if its false, it stays on the same page.
The problem lies in where if the user accepts, I have to keep an ID from the Php on the page, but don't know how to merge it in with javascript when I'm calling it to the new page, hope all this makes sense. This is the stripped down script:
**********
//this is where we click to get the confirm call
<a href="javascript:confirmDel();">Delete Entry</a>
//this is the function call specifically
<script language="JavaScript" type="text/javascript">
<!--
function confirmDel()
{
if(confirm("Are you sure you want to delete this entry?"))
{ clubDelete.phtml?clubID=$clubID"; }
else
{ alert('Confirming you are not deleting the entry'); }
}
//-->
</script>
//this is the query code for the page where the error is apparently coming from
$query = "DELETE FROM club" .
"WHERE clubID = '$clubID' ";
The error I'm specifically getting is: You have an error in your SQL syntax near 'clubID = $clubID' ' at line 1
If anyone knows how I can get the $clubID value over to the next page, would greatly appreciate it.
Thanks
Duniyadnd
The problem lies in where if the user accepts, I have to keep an ID from the Php on the page, but don't know how to merge it in with javascript when I'm calling it to the new page, hope all this makes sense. This is the stripped down script:
**********
//this is where we click to get the confirm call
<a href="javascript:confirmDel();">Delete Entry</a>
//this is the function call specifically
<script language="JavaScript" type="text/javascript">
<!--
function confirmDel()
{
if(confirm("Are you sure you want to delete this entry?"))
{ clubDelete.phtml?clubID=$clubID"; }
else
{ alert('Confirming you are not deleting the entry'); }
}
//-->
</script>
//this is the query code for the page where the error is apparently coming from
$query = "DELETE FROM club" .
"WHERE clubID = '$clubID' ";
The error I'm specifically getting is: You have an error in your SQL syntax near 'clubID = $clubID' ' at line 1
If anyone knows how I can get the $clubID value over to the next page, would greatly appreciate it.
Thanks
Duniyadnd