182x Posted July 20, 2007 Share Posted July 20, 2007 hey guys, just wondering where I went wrong with this syntax? Thanks $get= "SELECT * FROM use WHERE Id = $Id AND acc= $acc"; $query= mysql_query($get, $link_id) or die(mysql_error()); $temp=mysql_fetch_array($query) $del="DELETE FROM tech WHERE techId= $temp['Id']"; $mysql_query($del, $link_id)or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted July 20, 2007 Share Posted July 20, 2007 $mysql_query($del, $link_id)or die(mysql_error()); should be mysql_query($del, $link_id)or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
182x Posted July 20, 2007 Author Share Posted July 20, 2007 Still getting the same syntax error seems to be with this part of the code WHERE techId= $temp['Id']"; any ideas? Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 20, 2007 Share Posted July 20, 2007 try this <?php $del="DELETE FROM tech WHERE techId= '$temp[id]'"; ?> Quote Link to comment Share on other sites More sharing options...
benjaminbeazy Posted July 20, 2007 Share Posted July 20, 2007 Still getting the same syntax error seems to be with this part of the code WHERE techId= $temp['Id']"; any ideas? try WHERE techId = {$temp['Id']}"; if $query is returning more than 1 result you need to add a limit or use a loop... Quote Link to comment Share on other sites More sharing options...
182x Posted July 20, 2007 Author Share Posted July 20, 2007 with both I recieve the following error, anymore syntax suggestions? Parse error: syntax error, unexpected T_VARIABLE Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 20, 2007 Share Posted July 20, 2007 WHERE techId= "$temp['Id']"; ??? What about that? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.