logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 02-09-2007, 10:42 AM   #1
MintDanny
 
Join Date: Feb 2007
Posts: 14
Default syntax error (more help :D)

Hey,

i am just finsihed the delete data tutorial and i am getting this error

PHP Code:
You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'where field1_id='1'' at line 1 
now i havent a clue what this means.

any help is appreciated

Danny
MintDanny is offline   Reply With Quote
Old 02-09-2007, 10:49 AM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

paste the code you have in your delete script
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 02-09-2007, 11:14 AM   #3
MintDanny
 
Join Date: Feb 2007
Posts: 14
Default

Hey,

here is the php

PHP Code:
if ($del){
////////////////////////////////////////////////////
$query        sprintf("DELETE FROM where field1_id='$del'");
              
mysql_query($query)or die(mysql_error()); 
/////////////////////////////////////////////////////



and the actaul button is here;

PHP Code:
<input type="button" name="Submit2" value="Delete" onClick="document.location.href='dwc.php?del=<?php echo $row['field1_id'?>'" />
MintDanny is offline   Reply With Quote
Old 02-09-2007, 12:57 PM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

you are not telling the SQL where to delete from

you are missing a table

delete from table where
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com