wright67uk Posted February 22, 2011 Share Posted February 22, 2011 Im a bit stuck with the syntax on my query line. Im a newbie looking for some help or advice. Should i put brackets around the actual query? Many thanks. $confirm = $_GET['Id']; echo $confirm; echo "<p>complete</p>"; $query =mysql_query "UPDATE treesurgeons SET confirmed = 'Yes' WHERE Id = $confirm"; echo mysql_error(); ?></body></html> Link to comment https://forums.phpfreaks.com/topic/228536-my-first-sql-syntax-issue/ Share on other sites More sharing options...
Pikachu2000 Posted February 22, 2011 Share Posted February 22, 2011 What is the error? Link to comment https://forums.phpfreaks.com/topic/228536-my-first-sql-syntax-issue/#findComment-1178371 Share on other sites More sharing options...
BoarderLine Posted February 23, 2011 Share Posted February 23, 2011 Try: $conn = mysql_connect("localhost", "your_db_name", "your_db_pass") or die(mysql_error()); $confirm = $_GET['Id']; $query =mysql_query "UPDATE treesurgeons SET confirmed = 'Yes' WHERE Id = $confirm"; $sql_result = mysql_query ($query, $conn ) or die ('MySQL query error: '.$query); Link to comment https://forums.phpfreaks.com/topic/228536-my-first-sql-syntax-issue/#findComment-1178433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.