Jump to content

UPDATE query not working


MarkT

Recommended Posts

Hi All,

Unfortunately, My update query isn't working for a new CMS I'm creating.

mysqli_query($con2,"UPDATE system SET sys_alert='{$alert}'");

 

Is the query, but I think it's getting confused with the table name being called system

 

Would anyone be able to help? It's surrounded by an IF statement, which I know is functional as it is emailing me with the new alert variable (shown in query), and the old alert.

 

I appreciate any assistance you can provide.

 

Thanks in advance :)

Link to comment
Share on other sites

Fixed it,

The query was being ended early by a ' in the input field.

I solved it by using a STR replace

$alert = $_POST['alert'];$new2 = str_replace("'", "'", $alert);
Then using {$new2} as my variable,
Edited by MarkT
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...