Jump to content

a little help on a update table


hopbop

Recommended Posts

ok so here is whats going on i have this small little php to update one thing in a table but it's not updating the mysql_error is

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'check=1 WHERE id='21'' at line 1

what is the prob because i spent a hour on this and cant git it?

here is the php

 

<?php	
include '../config.php';
$id = $_GET['del'];
mysql_query("UPDATE call_list SET check=1 WHERE id='$id'")or die(mysql_error()); 
header("Location: index.php");
?>

Link to comment
https://forums.phpfreaks.com/topic/261310-a-little-help-on-a-update-table/
Share on other sites

Avoid reserved words for column names eg.CHECK

 

If you do use them, put them in backticks in the query eg `check`

 

http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html

 

thank you Barand that was the prob it works now.... and now a bit more wise about naming things lol

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.