dear all,

$member_id = $_POST['member_id'];
$delete = 'yes';

$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'hrs';


$link = mysqli_connect($HOST, $USERNAME, $PASSWORD, $DB);

$query = "UPDATE member SET delete='$delete' WHERE  member_id='$member_id'";

echo $query;


$result = mysqli_query($link, $query) or die(mysqli_error($link));

Any error in my query? it says 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 'delete='yes',member_type='none' WHERE member_id='19'' at line 1
However, This method i uses in other page is has no problem I have no idea what is the error, since everything is the same.

$query = "UPDATE members SET block='$active', role='$role' WHERE id='$id'";

your help is appreciated

Recommended Answers

All 5 Replies

The columns in your query and the syntax error don't match - where is member_type='none' come from?

Opps sorry wrong syntax error

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 'delete='yes' WHERE member_id='1'' at line 1

Is delete an inbuilt function in mysqli so you can't use it as a column name?

OMG YOU ARE RIHGT!

i've change delete to block, and everything works !
Thank you so much , i really appreciate

No problem:)

Please mark your thread as solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.